/* ========================================
   GREENTECH WEBSITE STYLES
   ======================================== */

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', 'Apple SD Gothic Neo', sans-serif;
    line-height: 1.6;
    color: #333;
    background: #fff;
    overflow-x: hidden;
}

/* ========================================
   HEADER STYLES
   ======================================== */
header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    color: #2e7d32;
    cursor: pointer;
}

.logo img {
    width: 40px;
    height: 40px;
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 3rem;
}

nav a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
}

nav a:hover {
    color: #2e7d32;
}

nav a:after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #2e7d32;
    transition: width 0.3s;
}

nav a:hover:after {
    width: 100%;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    z-index: 1001;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: #333;
    margin: 3px 0;
    transition: 0.3s;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero {
    background: linear-gradient(135deg, rgba(46, 125, 50, 0.85) 0%, rgba(27, 94, 32, 0.85) 100%), 
                url('https://images.unsplash.com/photo-1518770660439-4636190af475?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: white;
    padding: 10rem 5% 6rem;
    text-align: center;
    margin-top: 70px;
    position: relative;
    min-height: 600px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    animation: fadeInUp 1s ease;
}

.hero .subtitle {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    font-weight: 300;
    animation: fadeInUp 1s ease 0.2s both;
}

.mission-vision {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 10px;
    max-width: 800px;
    margin: 3rem auto 0;
    animation: fadeInUp 1s ease 0.4s both;
}

.mission-vision h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #4CAF50;
}

.mission-vision p {
    font-size: 1.1rem;
    line-height: 1.8;
}

/* ========================================
   SECTION COMMON STYLES
   ======================================== */
section {
    padding: 5rem 5%;
    max-width: 1400px;
    margin: 0 auto;
}

h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 1rem;
    color: #1b5e20;
    position: relative;
    padding-bottom: 1rem;
}

h2:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: #4CAF50;
}

.section-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

/* ========================================
   ABOUT SECTION
   ======================================== */
.about {
    background: #f8f9fa;
}

.about-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 3rem;
    align-items: center;
}

.about-text h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: #2e7d32;
}

.about-text p {
    margin-bottom: 1.5rem;
    color: #555;
    line-height: 1.8;
}

.company-values {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.value-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.value-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.value-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* ========================================
   TECHNOLOGY SECTION
   ======================================== */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.tech-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 2.5rem;
    text-align: center;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.tech-card:hover {
    border-color: #4CAF50;
    box-shadow: 0 10px 30px rgba(76, 175, 80, 0.2);
}

.tech-card:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 3px;
    background: #4CAF50;
    transition: left 0.3s;
}

.tech-card:hover:before {
    left: 0;
}

.tech-number {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 3rem;
    font-weight: bold;
    color: #f0f0f0;
}

.tech-card h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: #1b5e20;
    position: relative;
}

/* ========================================
   PORTFOLIO SECTION WITH GALLERY
   ======================================== */
.portfolio {
    background: #f8f9fa;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.portfolio-item {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.portfolio-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

/* Image Slider in Card */
.portfolio-image-slider {
    height: 250px;
    position: relative;
    overflow: hidden;
    background: #f0f0f0;
}

.slider-container {
    position: relative;
    height: 100%;
    width: 100%;
}

.slider-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.slider-image.active {
    opacity: 1;
}

.slider-image[onerror] {
    background: linear-gradient(45deg, #e8f5e9, #c8e6c9);
}

/* Slider Navigation */
.slider-prev,
.slider-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    padding: 10px 15px;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.3s;
    z-index: 2;
}

.slider-prev:hover,
.slider-next:hover {
    background: rgba(0,0,0,0.7);
}

.slider-prev {
    left: 10px;
}

.slider-next {
    right: 10px;
}

/* Slider Dots */
.slider-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 2;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background 0.3s;
}

.dot.active {
    background: white;
}

.dot:hover {
    background: rgba(255,255,255,0.8);
}

/* Portfolio Content */
.portfolio-content {
    padding: 2rem;
}

.portfolio-content h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: #1b5e20;
}

.portfolio-content p {
    color: #666;
    margin-bottom: 1rem;
}

/* Portfolio Tags */
.portfolio-tags {
    display: flex;
    gap: 8px;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.tag {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
}

.portfolio-btn {
    background: none;
    border: 2px solid #4CAF50;
    color: #4CAF50;
    padding: 8px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.portfolio-btn:hover {
    background: #4CAF50;
    color: white;
    transform: translateX(5px);
}

/* ========================================
   ENHANCED PORTFOLIO MODAL
   ======================================== */
.portfolio-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
    animation: fadeIn 0.3s;
}

.portfolio-modal.show {
    display: block;
}

.modal-content {
    background-color: #fefefe;
    margin: 2% auto;
    padding: 0;
    border-radius: 10px;
    width: 95%;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s;
}

.modal-close {
    color: #aaa;
    position: absolute;
    right: 25px;
    top: 15px;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 10;
}

.modal-close:hover,
.modal-close:focus {
    color: #000;
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
}

/* Gallery in Modal */
.modal-gallery {
    position: sticky;
    top: 0;
}

.gallery-main {
    position: relative;
    width: 100%;
    height: 400px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    padding: 15px 20px;
    font-size: 24px;
    cursor: pointer;
    transition: background 0.3s;
}

.gallery-nav:hover {
    background: rgba(0,0,0,0.9);
}

.gallery-prev {
    left: 10px;
}

.gallery-next {
    right: 10px;
}

/* Gallery Thumbnails */
.gallery-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    overflow-x: auto;
    padding: 5px;
}

.gallery-thumb {
    width: 80px;
    height: 80px;
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s, transform 0.3s;
    flex-shrink: 0;
}

.gallery-thumb.active {
    opacity: 1;
    border: 2px solid #4CAF50;
}

.gallery-thumb:hover {
    opacity: 1;
    transform: scale(1.05);
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Modal Info Section */
.modal-info {
    padding-right: 1rem;
}

.modal-info h2 {
    color: #1b5e20;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.modal-info h4 {
    color: #2e7d32;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.modal-details ul {
    list-style: none;
    padding-left: 0;
}

.modal-details li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.modal-details li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #4CAF50;
    font-weight: bold;
}

.modal-specs {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 5px;
    margin-top: 1rem;
}

/* Modal Action Buttons */
.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.modal-btn.primary {
    background: #4CAF50;
    color: white;
}

.modal-btn.primary:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

.modal-btn.secondary {
    background: white;
    color: #4CAF50;
    border: 2px solid #4CAF50;
}

.modal-btn.secondary:hover {
    background: #4CAF50;
    color: white;
}

/* Responsive Design for Gallery */
@media (max-width: 768px) {
    .modal-body {
        grid-template-columns: 1fr;
    }
    
    .gallery-main {
        height: 300px;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .portfolio-image-slider {
        height: 200px;
    }
}

/* ========================================
   LOCATION SECTION
   ======================================== */
.location {
    padding: 3rem 5%;
}

#map {
    height: 400px;
    width: 100%;
    border-radius: 10px;
    margin: 2rem 0;
    background: #f0f0f0;
}

.address-info {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

/* ========================================
   CONTACT SECTION
   ======================================== */
.contact {
    background: #1b5e20;
    color: white;
}

.contact h2 {
    color: white;
}

.contact h2:after {
    background: white;
}

.contact-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    margin-top: 3rem;
}

.contact-info {
    background: rgba(255,255,255,0.1);
    padding: 2rem;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.contact-item {
    margin-bottom: 1.5rem;
}

.contact-item h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #4CAF50;
}

.contact-form {
    background: rgba(255,255,255,0.1);
    padding: 2rem;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #c8e6c9;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 5px;
    background: rgba(255,255,255,0.1);
    color: white;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4CAF50;
    background: rgba(255,255,255,0.2);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255,255,255,0.6);
}

.submit-btn {
    background: #4CAF50;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.submit-btn:hover {
    background: #66BB6A;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.submit-btn:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
}

/* ========================================
   FOOTER
   ======================================== */
footer {
    background: #0d3e10;
    color: white;
    padding: 3rem 5%;
    text-align: center;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
}

.footer-info {
    margin-bottom: 2rem;
    line-height: 1.8;
}

.footer-info p {
    margin: 0.5rem 0;
}

/* ========================================
   UTILITIES
   ======================================== */

/* Alert Messages */
.alert {
    position: fixed;
    top: 100px;
    right: 20px;
    padding: 1rem 2rem;
    border-radius: 5px;
    color: white;
    z-index: 2000;
    animation: slideIn 0.3s ease;
}

.alert.success {
    background: #4CAF50;
}

.alert.error {
    background: #f44336;
}

/* Loading Spinner */
.loading-spinner {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3000;
    background: rgba(255,255,255,0.9);
    padding: 2rem;
    border-radius: 10px;
}

.loading-spinner.active {
    /* display: block; */
    display: block !important;
}

/* Force hide when explicitly set */
.loading-spinner[style*="display: none"] {
    display: none !important;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Scroll Animation */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 768px) {
    /* Navigation */
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: white;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0,0,0,0.05);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        margin: 1rem 0;
    }

    .hamburger {
        display: flex;
    }

    /* Hero */
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero .subtitle {
        font-size: 1.2rem;
    }

    /* Sections */
    h2 {
        font-size: 2rem;
    }
    
    .tech-grid,
    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    /* Modal */
    .modal-body {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 8rem 5% 4rem;
    }

    .company-values {
        grid-template-columns: 1fr;
    }

    .contact-container {
        grid-template-columns: 1fr;
    }
}