/* Header / Navbar Styles */
.navbar-container {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1400px;
    z-index: 1000;
    box-sizing: border-box; /* Ensure padding doesn't increase width */
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    overflow: visible; /* Allow dropdowns to overflow */
    transition: all 0.3s ease;
}

.navbar-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    /* Redesigned Background: Glassmorphic Dark + Gold Tint */
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 50px; /* More rounded, pill shape */
    box-shadow: 
        0 10px 30px rgba(0,0,0,0.5), 
        0 0 0 1px rgba(212, 175, 55, 0.2); /* Subtle gold border */
    border: 1px solid rgba(255,255,255,0.1);
    overflow: hidden; /* Contains the light beam */
}

/* Light Beam Animation (Şık Süzme Efekti) */
.navbar-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        to right,
        transparent 0%,
        rgba(255, 255, 255, 0.05) 40%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.05) 60%,
        transparent 100%
    );
    transform: skewX(-25deg);
    animation: lightBeam 12s infinite ease-in-out; /* Slower and smoother */
    pointer-events: none;
}

@keyframes lightBeam {
    0% { left: -100%; }
    40% { left: 200%; } /* Slower pass (takes ~4.8s) */
    100% { left: 200%; } /* Wait */
}

.logo-container {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    margin-right: 0;
}

.logo-wrapper {
    display: block;
    text-decoration: none;
}

.logo-frame {
    position: relative;
    padding: 10px 25px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    /* Background moved to .logo-bg-anim */
    /* Ghadidi / Metallic / Open Window Frame Style */
    box-shadow: 
        inset 0 0 20px rgba(255, 255, 255, 0.8),
        0 0 15px rgba(212, 175, 55, 0.2);
    transition: all 0.4s ease;
    backdrop-filter: blur(5px);
    /* overflow: hidden; REMOVED to allow corners to show */
}

/* New Container for Background & Light Animation (Clipped) */
.logo-bg-anim {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(230, 230, 230, 0.9);
    overflow: hidden; /* Clips the rotating light */
    z-index: 0;
}

/* Background Light Animation */
.logo-bg-anim::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle, 
        rgba(255, 255, 255, 0.8) 0%, 
        rgba(212, 175, 55, 0.2) 30%, 
        transparent 70%
    );
    opacity: 0.5;
    animation: rotateLight 10s linear infinite;
}

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

/* Corner Accents - Adjusted to be above background */
.logo-frame .corner-top-left {
    position: absolute;
    top: -2px;
    left: -2px;
    width: 15px;
    height: 15px;
    border-top: 3px solid var(--primary-color);
    border-left: 3px solid var(--primary-color);
    transition: all 0.4s ease;
    z-index: 2; /* Higher than bg */
}

.logo-frame .corner-bottom-right {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 15px;
    height: 15px;
    border-bottom: 3px solid var(--primary-color);
    border-right: 3px solid var(--primary-color);
    transition: all 0.4s ease;
    z-index: 2; /* Higher than bg */
}

.logo-frame:hover {
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.5);
    /* background: #ffffff;  Moved to .logo-bg-anim if needed, or keep transparent on parent */
}

.logo-frame:hover .logo-bg-anim {
    background: #ffffff;
}

/* Restore Moving Yellow Frame Effect */
.logo-frame:hover .corner-top-left,
.logo-frame:hover .corner-bottom-right {
    width: calc(100% + 4px); /* Full width + compensate for negative offset */
    height: calc(100% + 4px);
    opacity: 1;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

.site-logo {
    position: relative;
    z-index: 2; /* Ensure logo is above animation */
    height: 40px; 
    width: auto;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.nav-links {
    display: flex;
    gap: 5px; /* Reduced gap for continuous background effect */
    list-style: none;
    margin: 0;
    padding: 5px;
    position: relative;
    z-index: 2;
    background: rgba(255,255,255,0.05);
    border-radius: 30px;
    flex: 1 1 auto;
    min-width: 0;
    justify-content: center;
}

/* Spotlight / Lavalamp Background Element */
.nav-spotlight {
    position: absolute;
    top: 5px;
    left: 5px;
    height: calc(100% - 10px);
    background: linear-gradient(135deg, var(--primary-color) 0%, #f1c40f 100%);
    border-radius: 25px;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: -1;
    opacity: 0; /* Hidden initially, managed by JS */
    pointer-events: none;
    box-shadow: 
        0 0 15px rgba(212, 175, 55, 0.8),
        0 0 30px rgba(212, 175, 55, 0.4),
        inset 0 0 10px rgba(255, 255, 255, 0.4);
    filter: brightness(1.1);
}

.nav-links li {
    position: relative;
    z-index: 1;
}

.nav-links a {
    color: #ccc;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    border-radius: 25px;
    white-space: nowrap; /* Prevent text wrapping */
}

.nav-links a:hover {
    color: #fff;
}

.nav-links a.active {
    color: #ffffff; /* White text on gold spotlight */
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
    font-weight: 700;
}

.nav-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    z-index: 2;
    margin-left: 0;
    flex: 0 0 auto;
}

.nav-actions a {
    color: #fff;
    font-size: 16px;
    transition: all 0.3s;
    position: relative;
}

.nav-actions a:hover {
    color: var(--primary-color);
    transform: scale(1.2);
    text-shadow: 0 0 10px var(--primary-color);
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.lang-switch .flag-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 0.7rem;
    letter-spacing: 1px;
    color: #fff;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.lang-switch .flag-btn:hover {
    transform: none;
    text-shadow: none;
    border-color: rgba(212, 175, 55, 0.4);
    color: #fff;
}

.lang-switch .flag-btn.active {
    background: rgba(212, 175, 55, 0.25);
    border-color: rgba(212, 175, 55, 0.6);
    color: #fff8d9;
}

.lang-switch .flag {
    display: inline-block;
    width: 18px;
    height: 12px;
    border-radius: 3px;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
    background-size: cover;
    background-position: center;
}

.lang-switch .flag-tr {
    background-image: url("../images/flags/tr.svg");
}

.lang-switch .flag-en {
    background-image: url("../images/flags/us.svg");
}

/* Hamburger Menu (Hidden on Desktop) */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    cursor: pointer;
    z-index: 1001;
    margin-left: 10px; /* Reduced margin */
}

.hamburger-menu span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #fff;
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Dropdown Menu Styles */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 10px 0;
    min-width: 200px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1000;
    border: 1px solid rgba(255,255,255,0.1);
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    list-style: none;
    margin: 0;
}

.dropdown-menu a {
    display: block;
    padding: 12px 20px;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.dropdown-menu a:hover {
    background: rgba(212, 175, 55, 0.2);
    color: var(--primary-color);
    padding-left: 25px;
}

.dropdown-menu li:last-child a {
    border-bottom: none;
}

/* Responsive Styles */
@media (max-width: 1280px) {
    .navbar-container {
        padding: 12px 30px;
        width: 95%;
    }

    .nav-links a {
        padding: 8px 15px;
        font-size: 12px;
        gap: 3px;
    }

    .nav-actions {
        gap: 15px;
        margin-left: 15px;
    }
}

@media (max-width: 1024px) {
    .navbar-container {
        padding: 10px 20px;
        width: 98%;
    }
    
    .nav-links a {
        padding: 6px 10px;
        font-size: 11px;
    }

    .logo-frame {
        padding: 6px 12px;
    }

    .site-logo {
        height: 32px;
    }
}

@media (max-width: 1200px) {
    .navbar-container {
        /* Reset positioning to avoid creating a containing block for fixed children */
        transform: none;
        left: 0;
        right: 0;
        margin: 0 auto;
        width: 92%; /* Set safe width */
        overflow: visible; /* Ensure menu is not clipped */
        padding-right: 30px; /* Increase padding to keep hamburger inside pill curve */
    }

    .nav-actions {
        margin-left: auto; /* Push actions and hamburger to the right */
        gap: 15px;
    }

    /* Disable light beam on mobile */
    .navbar-bg::before {
        display: none;
    }

    .hamburger-menu {
        display: flex;
    }

    /* Mobile Menu Drawer */
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%; /* Hidden by default */
        width: 80%; /* Drawer width */
        max-width: 300px;
        height: 100vh;
        background: rgba(20, 20, 20, 0.95);
        backdrop-filter: blur(15px);
        flex-direction: column;
        justify-content: flex-start; /* Align to top for scrolling */
        align-items: center;
        gap: 0; /* Remove gap, handle via padding/margin */
        padding: 80px 0 40px 0; /* Add top padding */
        border-radius: 0;
        transition: right 0.4s ease-in-out;
        box-shadow: -5px 0 30px rgba(0,0,0,0.5);
        z-index: 1000;
        overflow-y: auto; /* Enable scrolling */
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        width: 100%;
        text-align: center;
        margin: 0;
    }

    .nav-links a {
        font-size: 18px;
        padding: 15px;
        width: 100%;
        display: flex; /* Ensure flex for centering */
        justify-content: center;
        border-radius: 0;
        border-bottom: 1px solid rgba(255,255,255,0.05); /* Separators */
    }

    /* Mobile Dropdown Fix */
    .dropdown-menu {
        position: static;
        width: 100%;
        min-width: unset;
        transform: none;
        box-shadow: none;
        background: rgba(0, 0, 0, 0.3); /* Darker bg for contrast */
        border: none;
        border-radius: 0;
        display: none; /* Hidden by default to collapse space */
        opacity: 1;
        visibility: visible;
        padding: 0;
        transition: none; /* Disable base transition */
    }

    /* Show dropdown on hover (tap) */
    .dropdown:hover .dropdown-menu {
        display: block;
        transform: none;
        animation: fadeIn 0.3s ease;
    }
    
    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    .dropdown-menu a {
        font-size: 15px;
        padding: 12px 20px;
        color: rgba(255, 255, 255, 0.7);
        border-bottom: 1px solid rgba(255,255,255,0.02);
        background: transparent;
    }
    
    .dropdown-menu a:hover {
        padding-left: 20px; /* Reset hover movement */
        background: rgba(255, 255, 255, 0.05);
        color: var(--primary-color);
    }

    .nav-spotlight {
        display: none; /* Disable spotlight on mobile */
    }

    /* Move nav-actions inside or hide them if preferred, 
       but for now let's keep them visible next to hamburger or move inside drawer */
    .nav-actions {
        display: none; /* Hide top actions on mobile to clean up */
    }
    
    /* Hamburger Animation when active */
    .hamburger-menu.active span:nth-child(1) {
        transform: translateY(8.5px) rotate(45deg);
    }
    
    .hamburger-menu.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger-menu.active span:nth-child(3) {
        transform: translateY(-8.5px) rotate(-45deg);
    }
}
