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

:root {
    --bg: #0A0C0F;
    --bg-soft: #14181C;
    --bg-card: #1F2A30;
    --border: #2C3A47;
    --text: #FFFFFF;
    --muted: #A8B3BD;
    --danger: #FF4D6D;
    --success: #00E0B3;
    --accent: #00E0B3;
    --accent-dark: #00C29F;
    --accent-rgb: 0, 224, 179;
    --accent-contrast: #04100D;
    --header-height: 70px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Inter", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.menu-open {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

img {
    max-width: 100%;
    display: block;
}

svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.2;
}

[hidden] {
    display: none !important;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-soft);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.header {
    position: fixed;
    inset: 0 0 auto 0;
    width: 100%;
    z-index: 1000;
    background: linear-gradient(180deg, rgba(10, 12, 15, 0.96) 0%, rgba(10, 12, 15, 0.78) 78%, transparent 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background 0.25s ease, box-shadow 0.25s ease;
}

.header.scrolled {
    background: rgba(10, 12, 15, 0.98);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

.header-content {
    height: var(--header-height);
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 26px;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    min-width: max-content;
}

.brand-logo img {
    height: 38px;
    width: auto;
    object-fit: contain;
}

.brand-logo span,
.auth-logo a,
.error-logo a {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.6px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-link {
    color: var(--text);
    font-size: 15px;
    font-weight: 500;
    position: relative;
    transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent);
}

.nav-link.active::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -7px;
    width: 100%;
    height: 2px;
    background: var(--accent);
    border-radius: 999px;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.icon-btn {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    color: var(--text);
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: color 0.2s ease, background 0.2s ease;
}

.icon-btn:hover {
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.08);
}

.notif-count {
    position: absolute;
    top: 3px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    color: #FFFFFF;
    background: var(--danger);
    border: 2px solid var(--bg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
}

.notification-dropdown {
    position: relative;
}

.notification-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: min(380px, calc(100vw - 24px));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    background: rgba(10, 13, 16, 0.985);
    box-shadow: 0 22px 64px rgba(0, 0, 0, 0.58);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    z-index: 80;
}

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

.notification-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 8px 11px;
    border-bottom: 1px solid rgba(44, 58, 71, 0.55);
    margin-bottom: 8px;
}

.notification-menu-head strong {
    font-size: 15px;
}

.notification-menu-head span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.notification-menu-list {
    display: grid;
    gap: 2px;
    max-height: min(440px, calc(100svh - 150px));
    overflow-y: auto;
    overscroll-behavior: contain;
}

.notification-menu-item {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 11px;
    align-items: center;
    min-height: 58px;
    padding: 9px 10px;
    border-radius: 11px;
    color: var(--text);
    transition: background 0.18s ease;
}

.notification-menu-item:hover,
.notification-menu-item.unread {
    background: rgba(var(--accent-rgb), 0.085);
}

.notification-menu-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--accent);
    display: grid;
    place-items: center;
}

.notification-menu-icon svg {
    width: 17px;
    height: 17px;
}

.notification-menu-copy {
    min-width: 0;
}

.notification-menu-item strong,
.notification-menu-item small {
    display: block;
}

.notification-menu-item strong {
    font-size: 13px;
    line-height: 1.3;
    margin-bottom: 2px;
}

.notification-menu-item small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.38;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-menu-empty {
    min-height: 96px;
    color: var(--muted);
    display: grid;
    place-items: center;
    gap: 8px;
    text-align: center;
    font-weight: 800;
}

.login-btn {
    height: 42px;
    padding: 0 18px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-contrast);
    font-weight: 800;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s ease, background 0.2s ease;
}

.login-btn:hover {
    transform: translateY(-1px);
    background: var(--accent-dark);
}

.profile-dropdown {
    position: relative;
}

.profile-btn {
    border: 0;
    color: var(--text);
    background: transparent;
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    /* color: #04100D; */
    color: var(--accent-contrast);
    display: grid;
    place-items: center;
    font-weight: 900;
}

.avatar img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: inherit;
}

.profile-name {
    max-width: 120px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    width: 245px;
    padding: 10px;
    border: 1px solid rgba(44, 58, 71, 0.75);
    border-radius: 16px;
    background: rgba(20, 24, 28, 0.98);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: 0.18s ease;
}

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

.dropdown-menu a,
.dropdown-form button {
    width: 100%;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--text);
    padding: 11px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    font-size: 14px;
    transition: background 0.2s ease, color 0.2s ease;
}

.dropdown-menu a:hover,
.dropdown-form button:hover {
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--accent);
}

.dropdown-form {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--border);
}

.hamburger-btn {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    background: transparent;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.hamburger-btn span {
    width: 24px;
    height: 2px;
    border-radius: 999px;
    background: var(--text);
    transition: 0.25s ease;
}

.hamburger-btn.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.overlay {
    position: fixed;
    inset: 0;
    z-index: 1090;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(3px);
}

.mobile-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: min(86vw, 360px);
    height: 100vh;
    z-index: 1100;
    padding: 22px;
    background: rgba(14, 17, 21, 0.98);
    border-left: 1px solid var(--border);
    transform: translateX(100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
}

.mobile-sidebar.active {
    transform: translateX(0);
}

.mobile-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 26px;
}

.mobile-sidebar-head strong {
    color: var(--accent);
    font-size: 22px;
}

.mobile-close {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 999px;
    color: var(--text);
    background: var(--bg-card);
    display: grid;
    place-items: center;
}

.mobile-nav-link,
.mobile-logout-btn {
    width: 100%;
    border: 0;
    border-radius: 14px;
    padding: 14px;
    color: var(--text);
    background: transparent;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    margin-bottom: 6px;
}

.mobile-nav-link:hover,
.mobile-nav-link.active,
.mobile-logout-btn:hover {
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--accent);
}

.mobile-nav-group {
    margin-bottom: 6px;
}

.mobile-nav-group > .mobile-nav-link {
    margin-bottom: 0;
}

.mobile-nav-toggle {
    cursor: pointer;
    text-align: left;
}

.mobile-nav-toggle-label {
    flex: 1;
}

.mobile-nav-chevron {
    width: 20px;
    height: 20px;
    margin-left: auto;
    display: grid;
    place-items: center;
    transition: transform 0.2s ease;
}

.mobile-nav-chevron svg {
    width: 18px;
    height: 18px;
}

.mobile-nav-group.open .mobile-nav-chevron {
    transform: rotate(180deg);
}

.mobile-nav-submenu {
    margin: 7px 0 9px 25px;
    padding: 4px 0 4px 12px;
    border-left: 1px solid rgba(var(--accent-rgb), 0.35);
    display: grid;
    gap: 3px;
}

.mobile-nav-submenu[hidden] {
    display: none;
}

.mobile-nav-sublink {
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 11px;
    font-size: 14px;
    font-weight: 700;
    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.mobile-nav-sublink svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.mobile-nav-sublink:hover,
.mobile-nav-sublink.active {
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.1);
}

.mobile-separator {
    height: 1px;
    background: var(--border);
    margin: 18px 0;
}

.mobile-logout-form {
    margin: 0;
}

.search-live-results {
    margin-top: 14px;
    padding: 10px;
    border: 1px solid rgba(44, 58, 71, 0.75);
    border-radius: 18px;
    background: rgba(20, 24, 28, 0.98);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
    display: grid;
    gap: 8px;
}

.search-live-item {
    padding: 9px;
    border-radius: 14px;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    transition: background 0.2s ease, color 0.2s ease;
}

.search-live-item:hover {
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.1);
}

.search-live-item img {
    width: 46px;
    height: 64px;
    border-radius: 9px;
    object-fit: cover;
    background: var(--bg-card);
}

.search-live-item strong,
.search-live-item small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-live-item strong {
    color: var(--text);
    font-size: 14px;
    margin-bottom: 4px;
}

.search-live-item small,
.search-live-empty {
    color: var(--muted);
    font-size: 13px;
}

.search-live-empty {
    padding: 16px;
    text-align: center;
}

.search-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(3, 5, 7, 0.78);
    backdrop-filter: blur(12px);
    display: grid;
    place-items: start center;
    padding: calc(var(--header-height) + 48px) 20px 20px;
}

.search-panel {
    width: min(760px, 100%);
    position: relative;
}

.search-close {
    position: absolute;
    top: -48px;
    right: 0;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    color: var(--text);
    background: rgba(20, 24, 28, 0.82);
    display: grid;
    place-items: center;
}

.search-form {
    width: 100%;
    min-height: 62px;
    padding: 7px 8px 7px 20px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 16px;
    background: rgba(16, 20, 24, 0.98);
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.62), 0 0 0 1px rgba(var(--accent-rgb), 0.04);
}

.search-form > svg {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    color: var(--muted);
}

.search-form input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-size: clamp(16px, 2.2vw, 19px);
}

.search-form button {
    height: 46px;
    padding: 0 17px;
    border: 0;
    border-radius: 11px;
    color: var(--accent-contrast);
    background: var(--accent);
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.search-form button svg {
    width: 17px;
    height: 17px;
}

.footer {
    margin-top: 80px;
    border-top: 1px solid rgba(44, 58, 71, 0.55);
    background: #080A0D;
}

.footer-inner {
    max-width: 1600px;
    margin: 0 auto;
    padding: 34px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.footer p {
    color: var(--muted);
    font-size: 14px;
    margin-top: 6px;
}

.footer-brand {
    min-width: 0;
}

.footer-clock {
    width: fit-content;
    margin-top: 14px;
    padding: 9px 12px;
    border: 1px solid rgba(var(--accent-rgb), 0.2);
    border-radius: 12px;
    color: var(--muted);
    background: rgba(var(--accent-rgb), 0.06);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.footer-clock svg {
    width: 16px;
    height: 16px;
    color: var(--accent);
    flex: 0 0 auto;
}

.footer-clock-label {
    font-weight: 700;
}

.footer-clock time {
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 22px;
    color: var(--muted);
    font-size: 14px;
}

.footer-links a:hover {
    color: var(--accent);
}

.btn-primary,
.btn-secondary,
.btn-info {
    min-height: 48px;
    padding: 0 22px;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 800;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn-primary {
    background: var(--accent);
    /* color: #05100D; */
    color: var(--accent-contrast);
}

.btn-primary:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
}

.btn-secondary,
.btn-info {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover,
.btn-info:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

@media (max-width: 1100px) {
    .nav-menu {
        gap: 18px;
    }

    .profile-name {
        display: none;
    }
}

@media (max-width: 900px) {
    .header-content {
        padding: 0 18px;
        gap: 12px;
    }

    .nav-menu {
        display: none;
    }

    .user-actions {
        margin-left: auto;
        gap: 14px;
    }

    .icon-btn.notif-btn,
    .profile-dropdown {
        display: inline-flex;
    }

    .hamburger-btn {
        display: inline-flex;
    }

    .login-btn {
        height: 38px;
        padding: 0 14px;
    }

    .footer-inner {
        align-items: flex-start;
        flex-direction: column;
    }
    
    .footer-clock {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .footer-links {
        flex-wrap: wrap;
    }
}

@media (max-width: 520px) {
    .header-content {
        padding: 0 14px;
    }

    .user-actions {
        gap: 10px;
    }

    .brand-logo img {
        max-width: 120px;
        height: 34px;
    }

    .icon-btn,
    .hamburger-btn {
        width: 38px;
        height: 38px;
    }

    .profile-btn {
        gap: 6px;
    }

    .avatar {
        width: 36px;
        height: 36px;
    }
    
    .brand-logo span {
        font-size: 20px;
    }

    .login-btn {
        font-size: 0;
        width: 40px;
        padding: 0;
        justify-content: center;
    }

    .notification-menu {
        position: fixed;
        top: calc(var(--header-height) + 8px);
        right: 12px;
        left: 12px;
        width: auto;
        max-height: calc(100svh - var(--header-height) - 20px);
    }

    .notification-menu-list {
        max-height: calc(100svh - var(--header-height) - 88px);
    }

    .search-overlay {
        padding: calc(var(--header-height) + 44px) 12px 16px;
    }

    .search-form {
        min-height: 56px;
        padding: 6px 6px 6px 15px;
        gap: 10px;
    }

    .search-form button {
        width: 44px;
        height: 44px;
        padding: 0;
    }

    .search-form button span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }
}
