header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #000;
    z-index: 9999;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border-bottom: 3px solid #a93226;
}

header.scrolled {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.header-container {
    position: relative;
    z-index: 10000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #000;
    will-change: transform;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-navigation {
    margin-right: 50px;
}

.dropdown-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    display: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
    pointer-events: none;
}

.dropdown-backdrop.active {
    opacity: 1;
    visibility: visible;
    display: block;
    pointer-events: auto;
}

.user-dropdown-menu {
    pointer-events: none;
}

.user-dropdown.active .user-dropdown-menu {
    pointer-events: auto;
}

.left-section {
    display: flex;
    align-items: center;
    position: relative;
    z-index: calc(var(--header-z-index) + 2);
}

.logo-container {
    display: flex;
    align-items: center;
    text-decoration: none;
    max-height: 55px;
    max-width: 55px;
}

.site-logo {
    height: 3rem;
    width: auto;
    margin-right: 10px;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    color: white;
    letter-spacing: -0.5px;
    transition: color 0.3s ease;
}

.logo-text:hover {
    color: var(--primary-color);
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: white;
    letter-spacing: -0.5px;
}

.logo:hover {
    font-size: 24px;
    font-weight: 700;
    color: #a93226;
    letter-spacing: -0.5px;
}

.logo-span {
    color:#a93226;
}

.right-section {
    display: flex;
    align-items: center;
    gap: 30px;
    position: relative;
    z-index: 10000;
}

.mobile-nav-extras {
    display: none;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--secondary-color);
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 10001;
}

.nav-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-close {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: white;
    position: absolute;
    top: 20px;
    right: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
    z-index: 10002;
}

.nav-close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

nav {
    position: relative;
    z-index: 10001;
}

nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

nav ul li {
    margin-left: 25px;
}

nav ul li a {
    font-weight: 500;
    padding: 5px 0;
    position: relative;
    display: flex;
    align-items: center;
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}

nav ul li a i {
    margin-right: 5px;
    color: var(--primary-color);
}

nav ul li a:hover {
    color: var(--primary-color);
}

nav ul li a:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    bottom: 0;
    left: 0;
    transition: width 0.3s ease;
}

nav ul li a:hover:after {
    width: 100%;
}

.language-selector {
    position: relative;
    margin-right: 15px;
    z-index: 10002;
}

.language-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid var(--primary-color);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    z-index: 10003;
}

.language-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.language-flag {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 15px;
    overflow: hidden;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.language-flag .fi {
    width: 20px !important;
    height: 15px !important;
    display: block;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    border-radius: 2px;
    line-height: 1;
}

.language-toggle .language-flag {
    width: 18px;
    height: 13px;
}

.language-toggle .language-flag .fi {
    width: 18px !important;
    height: 13px !important;
}

.language-option .language-flag {
    width: 24px;
    height: 18px;
    margin-right: 8px;
}

.language-option .language-flag .fi {
    width: 24px !important;
    height: 18px !important;
}

.language-toggle:hover .language-flag .fi,
.language-option:hover .language-flag .fi {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

[dir="rtl"] .language-option .language-flag {
    margin-right: 0;
    margin-left: 8px;
}

.language-code {
    font-weight: 600;
    letter-spacing: 0.5px;
}

.language-arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
    color: var(--primary-color);
}

.language-selector.active .language-arrow {
    transform: rotate(180deg);
}

/* Language Dropdown - EN YÃœKSEK Z-INDEX */
.language-dropdown {
    position: fixed !important;
    top: calc(100% + 10px);
    right: 0;
    width: 200px;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 99999;
}

.language-selector.active .language-dropdown {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.language-dropdown-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.language-dropdown-header i {
    color: var(--primary-color);
    font-size: 14px;
}

.language-options {
    max-height: 200px;
    overflow-y: auto;
}

.language-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: #ccc;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
    position: relative;
}

.language-option:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.language-option.active {
    background: rgba(192, 57, 43, 0.2);
    color: white;
    border-left: 3px solid var(--primary-color);
}

.language-option.loading {
    opacity: 0.6;
    pointer-events: none;
}

.language-option.loading::after {
    content: '';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.language-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.language-name {
    font-weight: 500;
    font-size: 14px;
    line-height: 1.2;
}

.language-code-small {
    font-size: 11px;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.language-check {
    color: var(--primary-color);
    font-size: 14px;
    margin-left: auto;
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

.user-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    z-index: 10003;
    height: 70px;
}

.user-avatar-btn {
    max-height: 70px;
}

.user-dropdown-header {
    border-bottom: #a93226;
}

.auth-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
}

.login-btn {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.login-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.user-avatar-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    backdrop-filter: blur(10px);
    border: 1px solid var(--primary-color);
    cursor: pointer;
    border-radius: 20px;
    padding: 4px 12px 4px 4px;
    transition: all 0.3s ease;
    color: white;
    text-decoration: none;
    position: relative;
    z-index: 10004;
}

.user-avatar-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    color: white;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.user-avatar-btn:hover .user-avatar {
    border-color: white;
    transform: scale(1.03);
}

.dropdown-arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
    margin-left: 4px;
    color: var(--primary-color);
    padding: 0 6px;
}

.user-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: fixed !important;
    top: calc(100% + 10px);
    right: 0;
    width: 280px;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 99999;
}

.user-dropdown.active .user-dropdown-menu {
    transform: translateY(0) !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

.user-dropdown-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-name {
    padding: 1rem;
    font-size: 18px;
}

.dropdown-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
    flex-shrink: 0;
}

.dropdown-user-info {
    flex: 1;
    min-width: 0;
}

.dropdown-name {
    display: block;
    font-weight: 600;
    color: white;
    font-size: 1rem;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-email {
    display: block;
    font-size: 0.8rem;
    color: #888;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 8px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #ccc;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.dropdown-item i {
    width: 16px;
    text-align: center;
    color: var(--primary-color);
}

.logout-item {
    color: #ff6b6b;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-item:hover {
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
}

.logout-item i {
    color: #ff6b6b;
}

.mobile-nav-extras {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav-extras h4 {
    color: var(--primary-color);
    font-size: 14px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mobile-language-section {
    margin-bottom: 25px;
}

.mobile-language-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    color: white;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.mobile-language-option:hover {
    color: var(--primary-color);
    padding-left: 10px;
}

.mobile-language-option.active {
    color: var(--primary-color);
    background: rgba(192, 57, 43, 0.1);
    border-radius: 4px;
    padding-left: 10px;
    padding-right: 10px;
}

.mobile-language-option .language-flag {
    font-size: 18px;
}

.mobile-language-option .language-name {
    flex: 1;
    font-weight: 500;
}

.mobile-language-option .fas.fa-check {
    color: var(--primary-color);
    font-size: 14px;
}

.mobile-user-section {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
}

.mobile-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 15px;
}

.mobile-user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    object-fit: cover;
}

.mobile-user-details {
    flex: 1;
}

.mobile-user-name {
    display: block;
    color: white;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 2px;
}

.mobile-user-email {
    display: block;
    color: #888;
    font-size: 13px;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    color: white;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    font-size: 15px;
}

.mobile-nav-item:hover {
    color: var(--primary-color);
    padding-left: 10px;
}

.mobile-nav-item i {
    width: 20px;
    text-align: center;
    color: var(--primary-color);
}

.mobile-nav-item.logout {
    color: #ff6b6b;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 15px;
    padding-top: 15px;
}

.mobile-nav-item.logout:hover {
    background: rgba(255, 107, 107, 0.1);
    border-radius: 4px;
    padding-left: 10px;
    padding-right: 10px;
}

.mobile-nav-item.logout i {
    color: #ff6b6b;
}

.nav-toggle:focus,
.nav-close:focus,
.user-avatar-btn:focus,
.dropdown-item:focus,
.language-toggle:focus,
.language-option:focus,
.mobile-language-option:focus,
.mobile-nav-item:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

body.using-keyboard .nav-toggle:focus,
body.using-keyboard .user-avatar-btn:focus,
body.using-keyboard .dropdown-item:focus,
body.using-keyboard .language-toggle:focus,
body.using-keyboard .language-option:focus,
body.using-keyboard .mobile-language-option:focus,
body.using-keyboard .mobile-nav-item:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

[aria-expanded="true"] .dropdown-arrow,
[aria-expanded="true"] .language-arrow {
    transform: rotate(180deg);
}

.user-dropdown-menu.force-fix,
.language-dropdown.force-fix {
    position: fixed;
    z-index: 999999;
    top: 70px;
    right: 20px;
}

.dropdown-portal {
    position: fixed;
    z-index: 99999;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
}

#userDropdownMenu,
#languageDropdown {
    position: fixed;
    z-index: 999999;
}

[dir="rtl"] .language-dropdown,
[dir="rtl"] .user-dropdown-menu {
    right: auto;
    left: 0;
}

[dir="rtl"] .language-selector {
    margin-right: 0;
    margin-left: 15px;
}

[dir="rtl"] .language-option.active {
    border-left: none;
    border-right: 3px solid var(--primary-color);
}

[dir="rtl"] .mobile-language-option:hover,
[dir="rtl"] .mobile-nav-item:hover {
    padding-left: 0;
    padding-right: 10px;
}

[dir="rtl"] nav {
    right: auto;
    left: -350px;
}

[dir="rtl"] nav.active {
    left: 0;
}

.user-dropdown-menu,
.language-dropdown,
.user-avatar-btn,
.language-toggle,
.nav-toggle,
nav,
.dropdown-backdrop,
.mobile-language-option,
.mobile-nav-item {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

.emergency-zindex-fix {
    position: fixed !important;
    z-index: 2147483647 !important;
    top: 70px !important;
    right: 20px !important;
}

.emergency-zindex-fix.mobile {
    right: 10px !important;
    left: 10px !important;
    width: calc(100vw - 20px) !important;
    max-width: 280px !important;
}

.force-visible {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    pointer-events: auto !important;
}

.nav-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.nav-backdrop.active {
    opacity: 1;
    visibility: visible;
}

:root {
    --primary-color: #a93226;
    --secondary-color: #2c3e50;
    --header-bg: #000;
    --dropdown-bg: rgba(0, 0, 0, 0.95);
    --dropdown-border: rgba(255, 255, 255, 0.1);
    --text-primary: #fff;
    --text-secondary: #ccc;
    --backdrop-color: rgba(0, 0, 0, 0.3);
    --mobile-nav-bg: linear-gradient(to bottom, #2c3e50, #1a252f);
}

body.nav-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

nav::-webkit-scrollbar {
    width: 6px;
}

nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

nav::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

nav::-webkit-scrollbar-thumb:hover {
    background: #a93226;
}

nav.active {
    animation: slideInRight 0.3s ease;
}

nav.closing {
    animation: slideOutRight 0.3s ease;
}

.user-dropdown-menu,
.language-dropdown {
    will-change: transform, opacity, visibility;
}