/* ============================================
   ZALVIORA — DIGITAL ARCHITECTS
   Ultra-Modern Agency UI
   ============================================ */

   :root {
    --bg-color: #020105;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-color: #5d00ff; /* Neon Purple */
    --accent-secondary: #00e5ff; /* Cyan */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body.agency-body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    width: 100%;
    cursor: auto;
}

/* ---- WebGL Canvas ---- */
#webgl-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh; /* Reverted to vh to ensure it covers the screen when address bar hides */
    z-index: 1; 
    pointer-events: none; 
}

/* ---- Loading Screen ---- */
#loading-screen {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background-color: var(--bg-color);
    z-index: 10000;
    display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 30px;
    transition: opacity 1s ease;
}

.progress-loader-wrapper {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
    width: 300px; max-width: 80vw;
}

.progress-bar-container {
    width: 100%; height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px; position: relative;
}

.progress-bar-fill {
    position: absolute; top: 0; left: 0;
    height: 100%;
    background: var(--accent-secondary);
    box-shadow: 0 0 15px var(--accent-secondary), 0 0 5px #fff;
    animation: fillProgress 2s infinite ease-in-out;
    border-radius: 4px;
}

@keyframes fillProgress {
    0% { width: 0%; opacity: 1; }
    70% { width: 100%; opacity: 1; }
    90%, 100% { width: 100%; opacity: 0; }
}

.loading-text {
    font-family: 'Inter', sans-serif; color: #fff; font-size: 14px;
    letter-spacing: 5px; text-transform: uppercase; font-weight: 300;
    opacity: 0.8;
    text-shadow: 0 0 10px rgba(0,229,255,0.5);
    animation: pulseText 2s infinite ease-in-out;
}
@keyframes pulseText { 
    0%, 100% { opacity: 0.4; text-shadow: 0 0 5px rgba(0,229,255,0.2); } 
    50% { opacity: 1; text-shadow: 0 0 20px rgba(0,229,255,0.8); } 
}

/* ---- Navigation ---- */
.glass-nav {
    position: fixed;
    top: 0; left: 0; width: 100%;
    padding: 12px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    background: linear-gradient(to bottom, rgba(2,1,5,0.8), transparent);
    backdrop-filter: blur(5px);
}
.logo {
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: 5px;
    color: #fff;
    display: flex;
    align-items: center;
}

.nav-logo-img {
    height: 60px;
    width: auto;
    object-fit: contain;
}
.nav-btn {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 10px 24px;
    border-radius: 30px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.nav-btn:hover {
    background: #fff;
    color: #000;
}

/* ---- Scroll Container ---- */
#scroll-container {
    position: relative;
    z-index: 10;
    overflow-x: hidden;
    width: 100%;
}
.scene {
    width: 100vw;
    height: 200svh; /* Using svh to prevent mobile address bar jump */
    position: relative;
    display: flex;
    align-items: center;
}
.scene:last-child {
    height: 100svh; /* Fixed to perfectly lock the final call to action in the center */
}

@media (max-width: 768px) {
    .scene {
        height: 140svh; /* Reduce scroll distance on mobile */
    }
    .scene:last-child {
        height: 100svh;
    }
}

/* ---- Typography & Overlays ---- */
.content-overlay {
    position: absolute;
    width: 100%;
    padding: 0 10vw;
    opacity: 0; /* Hidden initially, GSAP fades in */
}

/* Fix Scene 1 text to be visible on load in the first 100svh */
#scene-1 .content-overlay {
    top: 50svh;
    transform: translateY(-50%);
    opacity: 1; /* Visible immediately without waiting for JS */
}

.left-align { text-align: left; }
.right-align { text-align: right; }
.center-align { text-align: center; }

.hero-title {
    font-size: 8vw;
    line-height: 1.2; /* Increased from 0.9 to prevent clipping of letters like İ */
    font-weight: 900;
    letter-spacing: -2px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #fff 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-subtitle {
    font-size: 1.2rem;
    font-weight: 300;
    color: var(--text-secondary);
    max-width: 400px;
}

.section-title {
    font-size: 5vw;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 20px;
}
.section-desc {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 400px;
    margin-left: auto; /* For right-align */
}
.center-align .section-desc,
.center-align .hero-subtitle {
    margin: 0 auto;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 50px; left: 50px;
    display: flex; align-items: center; gap: 15px;
}
.scroll-indicator p {
    font-size: 0.7rem; text-transform: uppercase; letter-spacing: 2px;
    color: rgba(255,255,255,0.5);
}
.mouse {
    width: 20px; height: 30px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 10px;
    position: relative;
}
.mouse::before {
    content: ''; position: absolute;
    top: 5px; left: 50%; transform: translateX(-50%);
    width: 2px; height: 6px; background: #fff; border-radius: 2px;
    animation: scrollWheel 2s infinite;
}
@keyframes scrollWheel {
    0% { top: 5px; opacity: 1; }
    100% { top: 15px; opacity: 0; }
}

/* Primary Button */
.primary-btn {
    margin-top: 30px;
    background: linear-gradient(45deg, var(--accent-color), var(--accent-secondary));
    border: none;
    padding: 15px 40px;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 2px;
    border-radius: 30px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(93, 0, 255, 0.4);
}

/* ---- Contact Modal (Glassmorphism) ---- */
.modal {
    position: fixed; inset: 0;
    z-index: 1000; display: flex;
}
.modal.hidden { display: none; }
.modal-content { margin: auto; z-index: 10000; position: relative; }
.modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(10px);
}
.glass-panel {
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border-radius: 20px;
    padding: 50px;
    width: 90%; max-width: 400px;
    backdrop-filter: blur(20px);
    text-align: center;
}
.glass-panel h2 { margin-bottom: 30px; font-weight: 700; }
.close-btn {
    position: absolute; top: 20px; right: 25px;
    background: none; border: none; color: #fff; font-size: 24px; cursor: pointer;
}
/* ---- Premium Portfolio Modal ---- */
.portfolio-glass {
    position: relative;
    max-width: 1300px; width: 95%; max-height: 85vh; overflow-y: auto;
    padding: 50px; text-align: left;
    background: rgba(10, 10, 15, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px rgba(0,0,0,0.8), 0 0 100px rgba(0, 229, 255, 0.1) inset;
    border-radius: 30px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Custom Scrollbar for Modal */
.portfolio-glass::-webkit-scrollbar { width: 8px; }
.portfolio-glass::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); border-radius: 10px; }
.portfolio-glass::-webkit-scrollbar-thumb { background: rgba(0, 229, 255, 0.3); border-radius: 10px; }
.portfolio-glass::-webkit-scrollbar-thumb:hover { background: rgba(0, 229, 255, 0.6); }

.portfolio-glass .modal-title {
    font-size: 3rem; margin-bottom: 10px; text-align: center;
    font-weight: 800; letter-spacing: 2px;
    background: linear-gradient(90deg, #fff, #00e5ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.portfolio-glass .modal-desc {
    text-align: center; color: #a0a0b0; margin-bottom: 50px;
    font-size: 1.1rem; letter-spacing: 1px;
}

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

.portfolio-item {
    position: relative;
    background: linear-gradient(145deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.01) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px; 
    overflow: hidden; 
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
}
.portfolio-item:hover {
    transform: translateY(-12px);
    border-color: rgba(0, 229, 255, 0.4);
    box-shadow: 0 15px 35px rgba(0, 229, 255, 0.15), 0 5px 15px rgba(0,0,0,0.5);
    background: linear-gradient(145deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 100%);
}

.portfolio-image {
    position: relative; width: 100%; height: 240px; overflow: hidden;
}
.portfolio-image::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; width: 100%; height: 50%;
    background: linear-gradient(to top, rgba(10,10,15,1), transparent);
    pointer-events: none;
}
.portfolio-image img {
    width: 100%; height: 100%; object-fit: cover; object-position: top;
    transition: transform 0.6s ease;
}
.portfolio-item:hover .portfolio-image img { 
    transform: scale(1.08); 
}

.portfolio-overlay-hover {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 229, 255, 0.1); 
    display: flex; justify-content: center; align-items: center;
    opacity: 0; transition: all 0.4s ease;
    backdrop-filter: blur(3px);
    z-index: 2;
}
.portfolio-item:hover .portfolio-overlay-hover { opacity: 1; }

.view-btn {
    padding: 12px 28px; 
    background: #00e5ff; 
    color: #000; 
    border-radius: 30px;
    text-decoration: none; 
    font-weight: 800; 
    font-size: 0.95rem; 
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.4);
    transform: translateY(20px);
}
.portfolio-item:hover .view-btn {
    transform: translateY(0);
}
.view-btn:hover { 
    background: #fff;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.6);
}

.portfolio-info { 
    padding: 0 30px 30px 30px; 
    position: relative;
    z-index: 3;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.portfolio-info .category {
    font-size: 0.75rem; color: #00e5ff; text-transform: uppercase; letter-spacing: 2px;
    font-weight: 700; margin-bottom: 5px;
}
.portfolio-info h3 {
    font-size: 1.6rem; margin: 0 0 15px 0; color: #fff;
    font-weight: 700;
}
.portfolio-info p {
    font-size: 0.95rem; color: #a0a0b0; line-height: 1.6; margin-bottom: 20px;
    flex-grow: 1;
}

.tech-tags {
    display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto;
}
.tech-tags span {
    font-size: 0.7rem; padding: 6px 12px; 
    background: rgba(0, 229, 255, 0.05);
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 20px; color: #c0c0d0;
    font-weight: 600; letter-spacing: 0.5px;
}
#contact-form input, #contact-form textarea {
    width: 100%; padding: 15px; margin-bottom: 20px;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff; border-radius: 10px; font-family: inherit;
}
#contact-form input:focus, #contact-form textarea:focus {
    outline: none; border-color: var(--accent-secondary);
}
.submit-btn {
    width: 100%; padding: 15px;
    background: #fff; color: #000;
    border: none; border-radius: 10px; font-weight: bold; cursor: pointer;
    transition: 0.3s;
}
.submit-btn:hover { background: #e0e0e0; }

/* ============================================
   WHATSAPP FLOAT
   ============================================ */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 60px;
    height: 60px;
    background-color: var(--accent-secondary);
    color: #000;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50px) scale(0.8);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.whatsapp-float:hover {
    background-color: #fff;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.8);
    transform: scale(1.1) translateY(0);
}
.whatsapp-float.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(0) scale(1);
}

@media (max-width: 768px) {
    .whatsapp-float {
        bottom: env(safe-area-inset-bottom, 15px);
        left: 15px;
        width: 50px;
        height: 50px;
    }
    .whatsapp-float svg {
        width: 28px;
        height: 28px;
    }
}

/* ============================================
   MOBILE RESPONSIVENESS
   ============================================ */
@media (max-width: 768px) {
    /* Navigation */
    .glass-nav {
        padding: 10px 20px;
    }
    .nav-logo-img {
        height: 45px;
    }
    .logo {
        font-size: 1.2rem;
    }
    .nav-btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }

    /* Typography */
    .hero-title {
        font-size: 14vw;
        letter-spacing: -2px;
        line-height: 1.2;
    }
    .hero-subtitle {
        font-size: 1rem;
        margin-top: 15px;
    }
    .section-title {
        font-size: 12vw;
        letter-spacing: -1px;
    }
    .section-desc {
        font-size: 1rem;
        margin-left: 0;
    }

    /* Content Layout */
    .content-overlay {
        padding: 0 20px;
        width: 100%;
        text-align: center !important; /* Force center on mobile for better reading */
        display: flex;
        flex-direction: column;
        align-items: center !important;
    }
    
    .left-align, .right-align {
        align-items: center;
        text-align: center;
    }

    /* Modals */
    .glass-panel {
        width: 90%;
        padding: 30px;
    }
    
    /* Scroll Indicator */
    .scroll-indicator {
        bottom: 30px;
        left: 50%;
        transform: translateX(-50%);
    }

    /* Premium Portfolio Mobile Fixes */
    .portfolio-glass {
        padding: 25px;
        width: 95%;
        max-height: 80svh; /* svh prevents iOS address bar cutoff */
        border-radius: 20px;
    }
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 25px;
        padding-bottom: 25px; /* Ensures the last item's shadow and frame aren't cut off when scrolling */
    }
    .portfolio-glass .modal-title {
        font-size: 2rem;
    }
    .portfolio-glass .modal-desc {
        font-size: 0.95rem;
        margin-bottom: 30px;
    }
    .portfolio-item {
        border-radius: 15px;
    }
    .portfolio-image {
        height: 180px;
    }
    .portfolio-info {
        padding: 0 20px 20px 20px;
    }
    .portfolio-info h3 {
        font-size: 1.3rem;
    }
    .view-btn {
        padding: 10px 20px;
        font-size: 0.85rem;
    }
}

/* ---- Button Group & Secondary Button ---- */
.button-group {
    display: flex; 
    gap: 20px; 
    justify-content: center; 
    align-items: center; 
    margin-top: 30px;
    flex-wrap: wrap;
}
.button-group .primary-btn {
    margin-top: 0; /* Override the default margin-top so it aligns with secondary */
}

.secondary-btn {
    padding: 15px 40px; 
    font-size: 1rem; 
    font-weight: 700; 
    letter-spacing: 2px;
    font-family: 'Inter', sans-serif;
    color: #fff; 
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.4); 
    border-radius: 30px;
    cursor: pointer; 
    transition: all 0.3s ease;
}
.secondary-btn:hover {
    background: #fff; 
    color: #000;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(255, 255, 255, 0.2);
}

@media (max-width: 768px) {
    .button-group {
        flex-direction: column;
        gap: 15px;
    }
    .button-group .primary-btn, 
    .button-group .secondary-btn {
        width: 100%;
    }
}

/* ---- Services Section ---- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 50px;
    max-width: 1200px;
}
.service-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s ease;
    backdrop-filter: blur(10px);
}
.service-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 15px 30px rgba(0, 229, 255, 0.2), 0 0 20px rgba(0, 229, 255, 0.1) inset;
    border-color: rgba(0, 229, 255, 0.5);
}
.service-icon {
    position: relative;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,229,255,0.15) 0%, rgba(0,0,0,0) 70%);
    color: var(--accent-color);
    margin-bottom: 25px;
    box-shadow: inset 0 0 15px rgba(0, 229, 255, 0.05);
    border: 1px solid rgba(0, 229, 255, 0.1);
}
.service-icon svg {
    filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.6));
    width: 36px;
    height: 36px;
}
.service-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
}

/* ---- Services Modal ---- */
.service-glass {
    max-width: 900px;
}
.service-modal-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 30px;
}
.service-modal-icon {
    color: var(--accent-color);
}
.service-modal-body p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 30px;
}
.service-modal-body h3 {
    font-size: 1.3rem;
    color: var(--accent-color);
    margin: 30px 0 15px 0;
}
.service-modal-body ul {
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
}
.service-modal-body li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 12px;
    color: var(--text-secondary);
}
.service-modal-body li::before {
    content: "•";
    color: var(--accent-color);
    position: absolute;
    left: 0;
    font-weight: bold;
}
.service-modal-body .highlight {
    background: rgba(0, 229, 255, 0.05);
    border-left: 4px solid var(--accent-color);
    padding: 20px;
    border-radius: 0 10px 10px 0;
    margin: 30px 0;
}

@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: 1fr;
        padding: 0 20px;
        gap: 20px;
    }
    .service-card {
        padding: 30px 20px;
    }
    .service-modal-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    .service-modal-body {
        padding: 0 10px;
    }
}
