/* ==========================================================================
   MODERN NAVBAR - FUTURISTIC GLASSMORPHISM DESIGN
   ========================================================================== */

.navbar-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: var(--spacing-md) var(--spacing-lg);
    z-index: 1000;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: var(--spacing-md);
    animation: slideDown 0.6s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ==========================================================================
   ISLAND COMPONENTS - GLASSMORPHISM CONTAINERS
   ========================================================================== */

.island {
    background: var(--brand-primary);
    border: 1px solid rgba(33, 40, 66, 0.15);
    border-radius: var(--radius-full);
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-md),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: all var(--transition-base);
    position: relative;
}

/* Animated border glow */
.island::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: var(--brand-light);
    border-radius: var(--radius-full);
    opacity: 0;
    transition: opacity var(--transition-base);
    z-index: -1;
    filter: blur(8px);
}

.island:hover::before {
    opacity: 0.5;
}

.island:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    border-color: rgba(33, 40, 66, 0.25);
}

.center-island {
    grid-column: 2;
    padding: 8px 12px;
}

.right-island {
    grid-column: 3;
    justify-self: end;
    padding: 8px 12px;
}

/* ==========================================================================
   USER PROFILE DROPDOWN
   ========================================================================== */

.user-dropdown {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    background: transparent;
    border: none;
    color: white;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    padding: 2px 14px 2px 2px;
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
}

.user-avatar {
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.9);
}

.dropdown-icon {
    font-size: 0.75rem;
    transition: transform var(--transition-base);
    color: rgba(255, 255, 255, 0.6);
    margin-left: 4px;
}

.user-dropdown:hover .dropdown-icon {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 16px);
    right: 0;
    background: #ffffff;
    min-width: 220px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(33, 40, 66, 0.12);
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    border: 1px solid rgba(33, 40, 66, 0.05);
}

.user-dropdown::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 0;
    width: 100%;
    height: 20px;
}

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

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background var(--transition-fast);
}

.dropdown-item i {
    font-size: 1.1rem;
    color: var(--accent-blue);
    width: 20px;
    text-align: center;
}

a.dropdown-item:hover {
    background: rgba(33, 40, 66, 0.03);
}

.user-info-item {
    cursor: default;
}

.dropdown-divider {
    height: 1px;
    background: rgba(33, 40, 66, 0.06);
}

.logout-item {
    color: #e53e3e;
}

.logout-item i {
    color: #e53e3e;
}

a.logout-item:hover {
    background: rgba(229, 62, 62, 0.04);
}

/* ==========================================================================
   NAVIGATION ITEMS - ORİJİNAL STİLLER
   ========================================================================== */

.nav-list {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
}

.nav-item {
    position: relative;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 12px 20px;
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
    display: block;
    border: 1px solid transparent;
    overflow: hidden;
    z-index: 1;
}

/* Hover background effect */
.nav-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity var(--transition-base);
    z-index: -1;
    border-radius: var(--radius-full);
}

.nav-item:hover {
    color: #ffffff;
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

.nav-item:hover::after {
    opacity: 1;
}

/* Active state */
.nav-item.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--glass-border);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.2);
}

/* Shine sweep effect */
.nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
    transform: skewX(-20deg);
    transition: none;
    pointer-events: none;
}

.nav-item:hover::before {
    animation: shine-sweep 0.6s forwards;
}

@keyframes shine-sweep {
    0% { left: -100%; }
    100% { left: 200%; }
}

/* Primary action button (KAYIT OL BUTONU) */
.nav-item.primary-action {
    background: rgba(255, 255, 255, 0.95);
    color: var(--brand-primary);
    font-weight: 600;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.nav-item.primary-action:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.5), 0 8px 24px rgba(33, 40, 66, 0.2);
    background: #ffffff;
}

.nav-item.primary-action::after {
    display: none;
}

/* ==========================================================================
   İKON ANİMASYONU (SADECE ORTA MENÜ İÇİN)
   ========================================================================== */

.nav-list .nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-list .nav-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    transition: all var(--transition-base);
    flex-shrink: 0;
}

.nav-list .nav-item .nav-text {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: all var(--transition-base);
    margin-left: 0;
}

.nav-list .nav-item.active .nav-text {
    max-width: 120px;
    opacity: 1;
    margin-left: 8px;
}

/* ==========================================================================
   RESPONSIVE DESIGN (Masaüstü/Mobil Auth Kontrolü)
   ========================================================================== */
.desktop-auth {
    display: flex;
    gap: 8px;
    align-items: center;
}

.mobile-auth {
    display: none;
}

/* ==========================================================================
   RESPONSIVE DESIGN (Tek Satır İkonlu Mobil Tasarım)
   ========================================================================== */

@media (max-width: 968px) {
    .desktop-auth {
        display: none !important;
    }
    
    .mobile-auth {
        display: flex;
    }

    .navbar-wrapper {
        display: flex; 
        padding: 12px;
        gap: 12px;
        justify-content: center;
    }

    .navbar-left {
        display: none;
    }

    .center-island {
        flex: 0 1 auto;
        width: max-content;
        max-width: calc(100vw - 90px);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .center-island::-webkit-scrollbar {
        display: none;
    }

    .nav-list {
        width: max-content;
        padding: 2px;
    }

    /* BURASI YENİLENDİ: Sağ Ada ve Profil Dropdown Mobil Ayarları */
    .right-island {
        flex-shrink: 0;
        padding: 4px;
        border-radius: 50%; /* Tam yuvarlak */
    }

    /* Mobilde isim ve oku gizle, sadece avatar görünsün */
    .user-dropdown-toggle .user-name,
    .user-dropdown-toggle .dropdown-icon {
        display: none;
    }

    /* İsmi gizleyince sağda kalan boşluğu temizleyip kusursuz yuvarlak yapıyoruz */
    .user-dropdown-toggle {
        padding: 0; 
        gap: 0;
    }

    /* Mobilde açılır menünün ekrandan taşmaması için konumlandırma */
    .user-dropdown-menu {
        right: -10px; /* Kenara çok yapışmasın diye hafif kaydırıldı */
        top: calc(100% + 12px);
        min-width: 180px; 
    }
}

@media (max-width: 640px) {
    .navbar-wrapper {
        top: 0;
        padding: 10px;
    }

    .nav-item {
        padding: 10px 14px;
        font-size: 0.85rem;
    }

    .nav-list .nav-item.active .nav-text {
        max-width: 85px; 
        font-size: 0.8rem;
        margin-left: 6px;
    }
}

/* ==========================================================================
   FOOTER - SIMPLE & CLEAN
   ========================================================================== */

.footer {
    background: var(--gradient-primary);
    color: #ffffff;
    padding: 40px 0;
    margin-top: 100px;
}

.footer-content {
    max-width: 1400px;
    width: 90%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: #ffffff;
    text-decoration: none;
    transition: all var(--transition-base);
}

.footer-logo:hover {
    transform: translateY(-2px);
    text-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.footer-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

/* Copyright */
.footer-bottom {
    max-width: 1400px;
    width: 90%;
    margin: 24px auto 0;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.footer-bottom p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

@media (max-width: 768px) {
    html.od-mobile-sheet-lock,
    body.od-mobile-sheet-lock {
        overflow: hidden !important;
    }
}

/* ==========================================================================
   SHARED MOBILE NAVIGATION — HOMEPAGE + APP PAGES
   ========================================================================== */

:is(.hp-mobile-topbar, .od-mobile-topbar),
:is(.hp-mobile-bottom-nav, .od-mobile-bottom-nav),
:is(.hp-mobile-profile-backdrop, .od-mobile-profile-backdrop),
:is(.hp-mobile-profile-sheet, .od-mobile-profile-sheet) {
    display: none;
}

@media (max-width: 768px) {
    html {
        scroll-padding-top: 82px;
    }

    body {
        padding-bottom: calc(78px + env(safe-area-inset-bottom));
    }

    /* Desktop navbar is replaced completely on phones. */
    .navbar-wrapper {
        display: none !important;
    }

    /* ------------------------------------------------------------------
       MOBILE TOP BAR
       ------------------------------------------------------------------ */

    :is(.hp-mobile-topbar, .od-mobile-topbar) {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 5000;
        height: calc(64px + env(safe-area-inset-top));
        padding:
            calc(8px + env(safe-area-inset-top))
            10px
            8px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        background: rgba(248, 249, 252, .88);
        border-bottom: 1px solid rgba(33, 40, 66, .055);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    :is(.hp-mobile-brand, .od-mobile-brand) {
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 9px;
        text-decoration: none;
    }

    :is(.hp-mobile-brand-mark, .od-mobile-brand-mark) {
        width: 38px;
        height: 38px;
        flex: 0 0 38px;
        border-radius: 12px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        background: linear-gradient(145deg, #212842, #3b4667);
        box-shadow: 0 5px 14px rgba(33, 40, 66, .22);
        font-size: .88rem;
    }

    :is(.hp-mobile-brand-copy, .od-mobile-brand-copy) {
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 1px;
    }

    :is(.hp-mobile-brand-copy, .od-mobile-brand-copy) strong {
        color: #212842;
        font-size: .79rem;
        line-height: 1.1;
        letter-spacing: -.02em;
    }

    :is(.hp-mobile-brand-copy, .od-mobile-brand-copy) small {
        max-width: 160px;
        overflow: hidden;
        color: rgba(33, 40, 66, .42);
        font-size: .49rem;
        line-height: 1.1;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    :is(.hp-mobile-profile-btn, .od-mobile-profile-btn) {
        width: 39px;
        height: 39px;
        flex: 0 0 39px;
        border: 1px solid rgba(33, 40, 66, .08);
        border-radius: 12px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: #212842;
        background: #fff;
        box-shadow: 0 4px 14px rgba(33, 40, 66, .07);
        font-size: .83rem;
        cursor: pointer;
    }

    /* ------------------------------------------------------------------
       MOBILE BOTTOM NAV
       ------------------------------------------------------------------ */

    :is(.hp-mobile-bottom-nav, .od-mobile-bottom-nav) {
        position: fixed;
        left: 9px;
        right: 9px;
        bottom: calc(8px + env(safe-area-inset-bottom));
        z-index: 4900;
        height: 58px;
        padding: 5px;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 3px;
        border: 1px solid rgba(255, 255, 255, .95);
        border-radius: 18px;
        background: rgba(33, 40, 66, .95);
        box-shadow: 0 14px 34px rgba(20, 27, 48, .24);
        backdrop-filter: blur(22px);
        -webkit-backdrop-filter: blur(22px);
    }

    :is(.hp-mobile-bottom-nav, .od-mobile-bottom-nav) a {
        min-width: 0;
        min-height: 48px;
        padding: 5px 2px;
        border-radius: 13px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        color: rgba(255, 255, 255, .58);
        text-decoration: none;
        font-size: .47rem;
        font-weight: 600;
        line-height: 1;
    }

    :is(.hp-mobile-bottom-nav, .od-mobile-bottom-nav) a i {
        font-size: .78rem;
    }

    :is(.hp-mobile-bottom-nav, .od-mobile-bottom-nav) a.active {
        color: #212842;
        background: #fff;
        box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
    }

    /* ------------------------------------------------------------------
       MOBILE PROFILE SHEET
       ------------------------------------------------------------------ */

    :is(.hp-mobile-profile-backdrop, .od-mobile-profile-backdrop) {
        position: fixed;
        inset: 0;
        z-index: 6000;
        display: block;
        opacity: 0;
        visibility: hidden;
        background: rgba(12, 16, 31, .48);
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
        transition: opacity .24s ease, visibility .24s ease;
    }

    :is(.hp-mobile-profile-backdrop, .od-mobile-profile-backdrop).is-open {
        opacity: 1;
        visibility: visible;
    }

    :is(.hp-mobile-profile-sheet, .od-mobile-profile-sheet) {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 6100;
        max-height: min(78dvh, 640px);
        padding:
            8px
            14px
            calc(16px + env(safe-area-inset-bottom));
        display: block;
        overflow-y: auto;
        border-radius: 24px 24px 0 0;
        background: #f9fafe;
        box-shadow: 0 -20px 60px rgba(10, 13, 28, .22);
        transform: translateY(105%);
        transition: transform .30s cubic-bezier(.22, 1, .36, 1);
    }

    :is(.hp-mobile-profile-sheet, .od-mobile-profile-sheet).is-open {
        transform: translateY(0);
    }

    :is(.hp-mobile-sheet-handle, .od-mobile-sheet-handle) {
        width: 38px;
        height: 4px;
        margin: 2px auto 12px;
        border-radius: 999px;
        background: rgba(33, 40, 66, .16);
    }

    :is(.hp-mobile-sheet-head, .od-mobile-sheet-head) {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
    }

    :is(.hp-mobile-sheet-kicker, .od-mobile-sheet-kicker) {
        color: rgba(33, 40, 66, .38);
        font-size: .52rem;
        font-weight: 800;
        letter-spacing: .11em;
        text-transform: uppercase;
    }

    :is(.hp-mobile-sheet-head, .od-mobile-sheet-head) h2 {
        margin-top: 2px;
        color: #212842;
        font-size: 1.05rem;
        letter-spacing: -.025em;
    }

    :is(.hp-mobile-sheet-close, .od-mobile-sheet-close) {
        width: 36px;
        height: 36px;
        border: none;
        border-radius: 11px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: rgba(33, 40, 66, .55);
        background: rgba(33, 40, 66, .055);
    }

    :is(.hp-mobile-account-meta, .od-mobile-account-meta) {
        margin-top: 14px;
        padding: 10px;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 7px;
        border-radius: 13px;
        background: rgba(33, 40, 66, .045);
    }

    :is(.hp-mobile-account-meta, .od-mobile-account-meta) div {
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 6px;
        color: rgba(33, 40, 66, .6);
        font-size: .63rem;
    }

    :is(.hp-mobile-account-actions, .od-mobile-account-actions) {
        margin-top: 10px;
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    :is(.hp-mobile-account-actions, .od-mobile-account-actions) a {
        min-height: 58px;
        padding: 8px 10px;
        display: grid;
        grid-template-columns: 38px minmax(0, 1fr) auto;
        align-items: center;
        gap: 9px;
        border: 1px solid rgba(33, 40, 66, .07);
        border-radius: 13px;
        color: #212842;
        background: #fff;
        text-decoration: none;
    }

    :is(.hp-mobile-account-actions, .od-mobile-account-actions) a > span:nth-child(2) {
        min-width: 0;
        display: flex;
        flex-direction: column;
    }

    :is(.hp-mobile-account-actions, .od-mobile-account-actions) strong {
        font-size: .70rem;
    }

    :is(.hp-mobile-account-actions, .od-mobile-account-actions) small {
        color: rgba(33, 40, 66, .42);
        font-size: .53rem;
    }

    :is(.hp-mobile-action-icon, .od-mobile-action-icon) {
        width: 38px;
        height: 38px;
        border-radius: 10px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: rgba(33, 40, 66, .06);
    }

    :is(.hp-mobile-account-actions, .od-mobile-account-actions) a.is-danger {
        color: #c73d51;
    }

    .hp-mobile-sheet-intro {
        margin: 13px 0;
        color: rgba(33, 40, 66, .56);
        font-size: .68rem;
        line-height: 1.55;
    }

    .hp-mobile-auth-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 7px;
    }

    .hp-mobile-auth-actions a {
        min-height: 44px;
        padding: 9px;
        border: 1px solid rgba(33, 40, 66, .10);
        border-radius: 11px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        color: #212842;
        background: #fff;
        font-size: .68rem;
        font-weight: 700;
        text-decoration: none;
    }

    .hp-mobile-auth-actions a.is-primary {
        color: #fff;
        background: #212842;
        border-color: #212842;
    }

    /* ------------------------------------------------------------------
       FOOTER
       ------------------------------------------------------------------ */

    .footer {
        margin-top: 22px;
        padding: 22px 0 86px;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .footer-links {
        flex-direction: column;
        gap: 16px;
    }

    .social-links {
        justify-content: center;
    }

    .footer-bottom {
        width: calc(100% - 28px);
        margin: 0 auto;
        padding: 0;
        border-top: 0;
    }

    .footer-bottom p {
        font-size: .62rem;
        line-height: 1.45;
    }
}

@media (max-width: 390px) {
    :is(.hp-mobile-brand-copy, .od-mobile-brand-copy) small {
        max-width: 125px;
    }
}


/* Shared mobile shell refinements */
@media (max-width: 768px) {
    .od-mobile-brand {
        color: inherit;
    }

    .od-mobile-sheet-close {
        cursor: pointer;
    }
}

/* ==========================================================================
   SHARED SMALL-PHONE BRAND WIDTH
   ========================================================================== */

@media (max-width: 420px) {
    :is(.hp-mobile-brand-copy, .od-mobile-brand-copy) small {
        max-width: 128px;
    }
}
