:root {
    --bg-color: #ebedf0;
    --header-bg: #ffffff;
    --card-bg: #ffffff;
    --text-color: #000000;
    --text-muted: #818c99;
    --border-color: #e1e3e6;
    --divider-color: #e1e3e6;
    --sidebar-border: #d7d8dc;
    --search-bg: #ebedf0;
    --search-text: #000000;
    --create-btn-bg: #d9dce0;
    --special-story-bg: #f0f2f5;
    --dropdown-bg: #ffffff;
    --dropdown-hover: #f5f6f8;
    --mobile-nav-bg: rgba(255, 255, 255, 0.85);
    --mobile-nav-border: rgba(0, 0, 0, 0.15);
    --accent-color: #ff3366;
}

[data-theme="dark"] {
    --bg-color: #111111;
    --header-bg: #1c1c1e;
    --card-bg: #1c1c1e;
    --text-color: #f5f5f7;
    --text-muted: #8e8e93;
    --border-color: #2c2c2e;
    --divider-color: #38383a;
    --sidebar-border: #2c2c2e;
    --search-bg: #2c2c2e;
    --search-text: #f5f5f7;
    --create-btn-bg: #2c2c2e;
    --special-story-bg: #2c2c2e;
    --dropdown-bg: #2c2c2e;
    --dropdown-hover: #3a3a3c;
    --mobile-nav-bg: rgba(28, 28, 30, 0.85);
    --mobile-nav-border: rgba(255, 255, 255, 0.15);
    --accent-color: #ff453a;
}

* {
    box-sizing: border-box;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

body {
    margin: 0;
    font-family: Onest, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    -webkit-text-size-adjust: 100%;
}

/* Tək səhifələr (məsələn: Giriş səhifəsi) üçün mərkəzləşdirmə */
.main-page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ANA KONTEYNER VƏ SİDEBAR */
.main-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    max-width: 780px;
    margin: 48px auto 0 auto;
    padding: 12px 16px;
    gap: 20px;
}

/* HEADER STİLİ */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 48px;
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
}

.header-inner,
.main-container {
    max-width: 820px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.header-inner {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 20px;
}

.header-left-col {
    width: 240px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding-left: 2px;
}

.nav-logo {
    margin-left: 8px;
    width: 90px;
    height: 40px;
    display: block;
    background: url(/dist/img/logo/logo_90x35.webp) no-repeat center left;
    background-size: contain;
}

.nav-theme-toggle-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-home-dropdown-wrap {
    display: none !important;
}

.mobile-header-back {
    display: none;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    font-size: 15px;
    padding-left: 4px;
}

.header-middle-col {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    height: 100%;
}

.dropdown-container {
    position: relative;
    user-select: none;
}

.dropdown-menu {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    color: var(--text-color);
    padding: 4px 8px;
    border-radius: 6px;
}

.dropdown-menu:hover {
    background-color: var(--create-btn-bg);
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--dropdown-bg);
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 6px;
    z-index: 1001;
    border: 1px solid var(--border-color);
}

.dropdown-content.dropdown-left {
    right: auto;
    left: 0;
}

.desktop-page-title {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-color);
    padding: 0 8px;
}

.desktop-middle-dropdown .dropdown-content {
    left: 0 !important;
    right: auto !important;
}

.desktop-empty-card {
    display: none !important;
}
    
.dropdown-item, .dropdown-item-money {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 6px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 13px;
}

.dropdown-item-money {
    justify-content: space-between;
}

.dropdown-item:hover, .dropdown-item-money:hover {
    background-color: var(--dropdown-hover);
    text-decoration: none;
}

.dropdown-item.active::after {
    content: "✓";
    font-size: 14px;
    font-weight: bold;
    color: var(--accent-color);
    margin-left: auto;
}

.dropdown-item-money-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-divider {
    border: 0;
    border-top: 1px solid var(--divider-color);
    margin: 5px 0;
}

/* NAV-LINK VƏ TOOLTIP STİLİ */
.nav-link {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 4px 8px;
    border-radius: 6px;
    position: relative;
    transition: background-color 0.2s ease;
    color: var(--text-color);
    text-decoration: none;
}

.nav-link:hover {
    background-color: var(--create-btn-bg);
}

.nav-link.active {
    background: var(--create-btn-bg);
    box-shadow: inset 0 -3px 0 0 var(--accent-color);
}

/* Tooltip */
.custom-tooltip {
    display: none;
    position: absolute;
    bottom: -42px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.85);
    color: #ffffff;
    font-size: 11px;
    font-weight: 500;
    padding: 5px 11px;
    border-radius: 30px;
    white-space: nowrap;
    z-index: 1050;
    pointer-events: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.custom-tooltip::after {
    content: "";
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 5px 5px 5px;
    border-style: solid;
    border-color: transparent transparent rgba(0, 0, 0, 0.85) transparent;
}

.nav-link:hover .custom-tooltip {
    display: block;
}

.header-right-col {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.search-box {
    display: flex;
    align-items: center;
    background-color: var(--search-bg);
    border-radius: 20px;
    padding: 0 12px;
    height: 32px;
    width: 100%;
    max-width: 210px;
}

.search-icon {
    font-size: 12px;
    margin-right: 8px;
    color: var(--text-muted);
}

.search-input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 13px;
    width: 100%;
    color: var(--search-text);
}

.mobile-search-btn {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--text-color);
    border-radius: 50%;
    align-items: center;
    justify-content: center;
}

.mobile-search-btn:hover {
    background-color: var(--create-btn-bg);
}

.user-avatar-mini {
    position: relative;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.user-avatar-mini img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 7px 10px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    border-radius: 8px;
    margin: 1px 0;
    position: relative;
}

.nav-item:hover {
    background-color: var(--create-btn-bg);
}

.nav-item.active {
    color: var(--accent-color);
    font-weight: 500;
}

.nav-icon {
    margin-right: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
}

.profile-link {
    font-weight: 500;
}

.nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
}

.nav-badge {
    margin-left: auto;
    background-color: var(--text-muted);
    color: #fff;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 500;
}

.theme-toggle-btn {
    width: 100%;
    background: transparent;
    border: none;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
}

.sidebar {
    position: sticky;
    top: 30px;
    width: 240px;
    flex-shrink: 0;
    padding-top: 4px;
}

.sidebar::-webkit-scrollbar {
    display: none;
}

.sidebar-footer {
    padding: 12px 10px;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--sidebar-border);
    margin-top: 10px;
}

.sidebar-footer-links-row {
    margin-bottom: 4px;
}

.sidebar-footer a {
    color: var(--text-muted);
    text-decoration: none;
    margin-right: 8px;
}

.sidebar-footer a:hover {
    color: var(--text-color);
}

.sidebar-divider {
    border: none;
    border-top: 1px solid var(--sidebar-border);
    margin: 6px 0px;
    height: 0;
    opacity: 1;
}

.sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 7px 10px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    border-radius: 8px;
    margin: 1px 0;
    position: relative;
}

.sidebar-link:hover {
    background-color: var(--create-btn-bg);
}

.sidebar-link.active {
    color: var(--accent-color);
    font-weight: 500;
}

.sidebar-icon {
    margin-right: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
}

.sidebar-user-card {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-user-link {
    display: flex;
    align-items: center;
    padding: 7px 3px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    border-radius: 8px;
    margin: 1px 0;
    position: relative;
}

.sidebar-profile-link {
    font-weight: 500;
}

.sidebar-user-avatar {
    margin-right: 12px;
}

.sidebar-user-ava32 {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

/* MƏZMUN (CONTENT) HİSSƏSİ */
.content-area {
    width: 560px;
    flex-shrink: 0;
}

.stories-card {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 12px !important;
}

.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.story-avatar-wrap {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    padding: 2px;
    border: 2px solid var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: space-around;
}

.story-avatar-wrap img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.story-add-badge {
    position: absolute;
    bottom: -2px;
    right: -5px;
    width: 20px;
    height: 20px;
    background-color: var(--accent-color);
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--card-bg);
    font-weight: bold;
}

.special-story {
    border: 2px solid var(--text-muted);
    background: var(--special-story-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.story-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--text-color);
}

.story-icon svg {
    width: 85% !important;
    height: 85% !important;
}

.story-title {
    font-size: 12px;
    margin-top: 6px;
    color: var(--text-color);
}

.create-post-card {
    padding: 10px;
}

.create-post-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--create-btn-bg);
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    height: 38px;
    border-radius: 10px;
    gap: 6px;
}

.plus-icon {
    font-size: 16px;
    font-weight: bold;
}

.mobile-bottom-nav {
    display: none;
}

/* RESPONSİV QAYDALAR (1023px və aşağı ekranlar üçün) */
@media screen and (max-width: 1023px) {
    .sidebar {
        display: none !important;
    }
    
    .desktop-middle-dropdown {
        display: none !important;
    }

    .mobile-home-dropdown-wrap {
        display: flex !important;
    }
    
    .desktop-only-title {
        display: none !important;
    }
    .mobile-only-title {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        height: 100%;
    }
    
    .desktop-search {
        display: none !important;
    }

    .mobile-search-btn {
        display: flex !important;
    }

    .desktop-logo {
        display: none !important;
    }
    
    .desktop-page-title {
        display: none !important;
    }
    
    .mobile-header-back {
        display: flex !important;
    }

    .header-left-col {
        width: auto !important;
        flex: 1;
        padding-left: 0;
    }
    
    .header-inner,
    .main-container {
        max-width: 100% !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    
    .content-area {
        width: 100% !important;
    }

    .top-header {
        height: 50px;
    }

    .main-container {
        margin-top: 50px;
        padding-top: 10px;
        padding-bottom: 55px !important;
    }

    .stories-card {
        gap: 14px;
        padding: 12px !important;
    }

    .story-avatar-wrap {
        width: 58px;    
        height: 58px;   
        border-width: 2px;
    }

    .story-title {
        font-size: 12px; 
        margin-top: 5px;
        font-weight: 500;
    }

    .create-post-card {
        padding: 10px;
    }

    .create-post-btn {
        height: 40px;
        font-size: 14px; 
        font-weight: 500;
        border-radius: 10px;
    }

    .mobile-bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: calc(52px + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
        background-color: var(--mobile-nav-bg);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 0.5px solid var(--mobile-nav-border);
        z-index: 1000;
        justify-content: space-around;
        align-items: center;
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-decoration: none;
        color: var(--text-muted);
        position: relative;
        flex: 1;
        padding-top: 4px;
    }

    .mobile-icon {
        font-size: 22px; 
        line-height: 1;
    }
    
    .mobile-nav-text {
        font-size: 11px; 
        margin-top: 2px;
        font-weight: 500;
    }
    
    .mobile-nav-item.active {
        color: var(--accent-color);
    }

    .mobile-badge {
        position: absolute;
        top: 2px;
        right: 25%;
        background-color: var(--accent-color);
        color: #fff;
        font-size: 10px;
        padding: 1px 5px;
        border-radius: 10px;
        font-weight: bold;
    }
    
    .custom-tooltip {
        bottom: -34px;
        font-size: 10px;
        padding: 3px 8px;
    }
}

@media screen and (min-width: 1024px) {
    .desktop-only-title {
        display: flex !important;
    }
    .mobile-only-title {
        display: none !important;
    }
}

@media (min-width: 1024px) {
    .mobile-menu-wrapper {
        display: none !important;
    }
    .desktop-empty-card {
        display: block !important;
    }
}

/* --- ÜMUMİ VƏ TƏK SƏHİFƏLƏR ÜÇÜN CARD (KART) KOMPONENTLƏRİ --- */
.card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 6px;
    margin-bottom: 12px;
    width: 100%;
}

.single-page-card-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 20px 16px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--divider-color);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card-input {
    width: 100%;
    height: 40px;
    padding: 0 14px;
    background-color: var(--search-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 14px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.card-input:focus {
    border-color: var(--accent-color);
}

.card-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 40px;
    background-color: var(--accent-color);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.2s ease;
    text-decoration: none;
}

.card-btn:hover {
    opacity: 0.9;
}

.news-card {
    text-align: center; 
    padding: 12px;
}

.news-card-text {
    color: var(--accent-color);
    font-size: 14px; 
    line-height: 1.3;
}

/* Geri qayıt düyməsinin yumru arxa fonu */
.mobile-header-back-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--text-color);
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.mobile-header-back-icon:hover {
    background-color: var(--create-btn-bg);
}

/* Başlıq mətni */
.desktop-page-title-text {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}