/* ══════════ CORE LAYOUT FIX ══════════ */
:root {
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 72px;
    --header-height: 64px;
}

.dark {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --border-color: #334155;
    --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.light {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --border-color: #e2e8f0;
    --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 100px;
}

/* ══════════ TICKER ══════════ */
.ticker-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: 40px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    align-items: center;
}

.ticker-content {
    display: inline-flex;
    animation: tickerScroll 40s linear infinite;
    white-space: nowrap;
}

.ticker-content:hover {
    animation-play-state: paused;
}

@keyframes tickerScroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.ticker-content>div {
    padding: 0 20px;
}

.crypto-logo-sm {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-tertiary);
    flex-shrink: 0;
}

/* ══════════ SIDEBAR (FIXED) ══════════ */
.sidebar {
    position: fixed;
    top: 40px;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    z-index: 40;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .sidebar-label,
.sidebar.collapsed .sidebar-badge,
.sidebar.collapsed .sidebar-logo-text,
.sidebar.collapsed .sidebar-section-title {
    display: none;
}

.sidebar.collapsed .sidebar-item {
    justify-content: center;
    padding: 10px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    margin-bottom: 2px;
    white-space: nowrap;
    font-family: inherit;
}

.sidebar-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sidebar-item.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.08));
    color: #3b82f6;
    font-weight: 600;
}

.sidebar-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 1023px) {
    .sidebar {
        top: 0;
        transform: translateX(-100%);
        z-index: 60;
        width: var(--sidebar-width) !important;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 4px 0 32px rgba(0, 0, 0, 0.4);
    }
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 55;
    backdrop-filter: blur(3px);
}

.sidebar-overlay.active {
    display: block;
}

/* ══════════ MAIN CONTENT (with margin) ══════════ */
.main-content {
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.main-content.sidebar-collapsed {
    margin-left: var(--sidebar-collapsed-width);
}

@media (max-width: 1023px) {
    .main-content {
        margin-left: 0 !important;
    }
}

/* ══════════ HEADER ══════════ */
.main-header {
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 40px;
    z-index: 30;
    backdrop-filter: blur(12px);
}

/* ══════════ COMPONENTS ══════════ */
.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.badge-green {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

.badge-red {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.badge-yellow {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.badge-purple {
    background: rgba(139, 92, 246, 0.12);
    color: #8b5cf6;
}

.badge-blue {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
}

.crypto-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: all 0.2s;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px;
    border-radius: 10px;
    transition: all 0.15s;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    font-family: inherit;
}

.btn-ghost:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.theme-switch {
    width: 50px;
    height: 27px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
    flex-shrink: 0;
}

.theme-switch.active {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.theme-switch-thumb {
    width: 21px;
    height: 21px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.theme-switch.active .theme-switch-thumb {
    transform: translateX(23px);
    background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.dark .light-icon {
    display: none;
}

.dark .dark-icon {
    display: block;
}

.light .light-icon {
    display: block;
}

.light .dark-icon {
    display: none;
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 100;
    min-width: 180px;
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(0.97);
    transition: all 0.18s;
    pointer-events: none;
}

.dropdown-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.dropdown-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* ══════════ SUPPORT PAGE STYLES ══════════ */
.support-hero {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(139, 92, 246, 0.08));
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 20px;
    padding: 40px 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.support-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, transparent 60%);
    pointer-events: none;
}

.hero-search {
    max-width: 560px;
    margin: 20px auto 0;
    position: relative;
}

.hero-search-input {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 14px 20px 14px 48px;
    font-size: 15px;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
}

.hero-search-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.hero-search-input::placeholder {
    color: var(--text-tertiary);
}

.help-tile {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 22px;
    transition: all 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.help-tile:hover {
    border-color: rgba(59, 130, 246, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(59, 130, 246, 0.1);
}

.contact-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 22px;
    transition: all 0.2s;
    text-align: center;
}

.contact-card:hover {
    border-color: rgba(59, 130, 246, 0.35);
    transform: translateY(-2px);
}

.faq-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.faq-item:hover {
    border-color: rgba(59, 130, 246, 0.25);
}

.faq-item.open {
    border-color: rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(139, 92, 246, 0.03));
}

.faq-question {
    width: 100%;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: left;
    font-family: inherit;
}

.faq-icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s;
}

.faq-item.open .faq-icon {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    transform: rotate(180deg);
}

.faq-item.open .faq-icon i {
    color: white;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.faq-item.open .faq-answer {
    max-height: 400px;
}

.faq-answer-inner {
    padding: 0 18px 16px;
    color: var(--text-secondary);
    font-size: 13.5px;
    line-height: 1.6;
}

.chat-widget {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 500px;
}

.chat-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.05));
    border-bottom: 1px solid var(--border-color);
}

.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 400px;
}

.chat-msg {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    animation: msgIn 0.3s ease-out;
}

@keyframes msgIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-msg.bot {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.chat-msg.user {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-msg-time {
    display: block;
    font-size: 10px;
    margin-top: 4px;
    opacity: 0.7;
}

.chat-input-area {
    padding: 14px 18px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    background: var(--bg-primary);
}

.chat-input {
    flex: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 11px 16px;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
}

.chat-input:focus {
    border-color: #3b82f6;
}

.chat-send {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.chat-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.typing-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-tertiary);
    margin: 0 1px;
    animation: typingBounce 1.2s ease-in-out infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.5;
    }

    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

.ticket-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.2s;
    cursor: pointer;
}

.ticket-item:hover {
    border-color: rgba(59, 130, 246, 0.35);
    transform: translateX(2px);
}

.priority-pill {
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 700;
}

.priority-low {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.priority-medium {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.priority-high {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.article-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px;
    transition: all 0.2s;
    cursor: pointer;
    display: flex;
    gap: 14px;
    align-items: start;
}

.article-card:hover {
    border-color: rgba(59, 130, 246, 0.35);
    background: var(--bg-tertiary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.status-dot.up {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.status-dot.warn {
    background: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.status-dot.down {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.form-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 11px 14px;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.form-select {
    appearance: none;
    cursor: pointer;
    padding-right: 36px;
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.support-tab {
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-tertiary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    font-family: inherit;
}

.support-tab:hover {
    color: var(--text-primary);
}

.support-tab.active {
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.support-tab-content {
    display: none;
}

.support-tab-content.active {
    display: block;
    animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#toast {
    position: fixed;
    bottom: 16px;
    right: 16px;
    left: 16px;
    max-width: 380px;
    margin-left: auto;
    z-index: 9999;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    transform: translateY(120px);
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#toast.show {
    transform: translateY(0);
    opacity: 1;
}

@media (max-width: 640px) {
    .support-hero {
        padding: 28px 18px;
    }

    .support-hero h1 {
        font-size: 22px !important;
    }

    .help-tile {
        padding: 16px;
    }

    .contact-card {
        padding: 18px;
    }

    .chat-widget {
        min-height: 420px;
    }

    .chat-msg {
        max-width: 90%;
    }

    #toast {
        left: 12px;
        right: 12px;
        bottom: 12px;
        max-width: none;
        margin-left: 0;
    }
}

.main-content {
    flex: 1;
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

.main-wrapper {
    display: flex;
    width: 100%;
    min-width: 0;
}

@media (min-width:1024px) {
    .main-content {
        margin-left: var(--sidebar-width);
        width: calc(100% - var(--sidebar-width));
    }
}