/* =========================================================
   ENGLOVOICE IELTS DASHBOARD
   SIDEBAR + HEADER
   ========================================================= */

:root {
    /* Base */
    --deep-space: #ffffff;
    --star-dust: #0f172a;
    --muted-text: #475569;
    --border: rgba(37, 99, 235, 0.14);
    --surface: #ffffff;
    --surface-2: rgba(15, 23, 42, 0.02);
    --shadow: 0 14px 40px rgba(15, 23, 42, 0.10);

    /* Brand */
    --neon-blue: #2563EB;
    --electric-purple: #0EA5E9;
    --cosmic-blue: #1D4ED8;
    --galaxy-purple: #0284C7;

    /* Accents */
    --cyber-pink: #F97316;
    --accent-green: #16A34A;
    --amber: #F59E0B;

    /* Layout */
    --sidebar-width: 280px;
}


/* =========================================================
   BASE
   ========================================================= */

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    background-color: var(--deep-space);
    color: var(--star-dust);
    overflow-x: hidden;
}


/* =========================================================
   DASHBOARD CONTAINER
   ========================================================= */

.dashboard-container {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: auto 1fr;
    position: relative;
}


/* =========================================================
   SIDEBAR
   ========================================================= */

.sidebar {
    grid-column: 1 / 2;
    grid-row: 1 / 3;

    background: rgba(255, 255, 255, 0.96);

    padding: 26px 22px;

    height: 100vh;
    box-sizing: border-box;

    position: fixed;
    left: 0;
    top: 0;

    width: var(--sidebar-width);

    border-right: 1px solid var(--border);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    transition:
        transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    z-index: 1000;

    overflow-x: hidden;
    overflow-y: auto;

    scrollbar-width: thin;
    scrollbar-color: transparent transparent;

    box-shadow:
        2px 0 28px rgba(15, 23, 42, 0.06);

    display: flex;
    flex-direction: column;
}


/* =========================================================
   SIDEBAR TOP ACCENT
   ========================================================= */

.sidebar::before {
    content: '';

    position: absolute;

    top: 0;
    left: 0;
    right: 0;

    height: 1px;

    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(37, 99, 235, 0.35) 50%,
        transparent 100%
    );

    pointer-events: none;
}


/* =========================================================
   SIDEBAR RIGHT GLOW
   ========================================================= */

.sidebar::after {
    content: '';

    position: absolute;

    top: 0;
    bottom: 0;
    right: 0;

    width: 1px;

    background: linear-gradient(
        180deg,
        rgba(37, 99, 235, 0),
        rgba(37, 99, 235, 0.18),
        rgba(37, 99, 235, 0)
    );

    pointer-events: none;
}


/* =========================================================
   SIDEBAR SCROLLBAR
   ========================================================= */

.sidebar::-webkit-scrollbar {
    width: 7px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 10px;
}

.sidebar:hover {
    scrollbar-color: rgba(37, 99, 235, 0.60) transparent;
}

.sidebar:hover::-webkit-scrollbar-thumb {
    background: linear-gradient(
        180deg,
        rgba(37, 99, 235, 0.55),
        rgba(14, 165, 233, 0.35),
        rgba(37, 99, 235, 0.55)
    );
}


/* =========================================================
   LOGO
   ========================================================= */

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;

    padding: 7px 4px 8px;

    margin-bottom: 8px;

    flex-shrink: 0;

    background: transparent;
    border: none;
}


.logo-container a {
    display: flex;
    align-items: center;
    justify-content: center;
}


.logo-icon {
    width: 180px;
    height: 32px;

    object-fit: contain;

    display: block;
}


/* =========================================================
   PORTAL SWITCHER
   IELTS / SAT
   ========================================================= */

.portal-switcher {
    width: 100%;

    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 4px;

    padding: 4px;

    margin: 8px 0 18px;

    background: #f1f5f9;

    border: 1px solid rgba(37, 99, 235, 0.10);

    border-radius: 13px;

    box-sizing: border-box;

    flex-shrink: 0;
}


/* Portal tab */

.portal-tab {
    min-height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    padding: 7px 8px;

    border-radius: 9px;

    color: #64748b;

    text-decoration: none;

    font-size: 0.82rem;
    font-weight: 800;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.15s ease;
}


.portal-tab i {
    font-size: 0.92rem;
}


/* Hover */

.portal-tab:hover {
    color: var(--neon-blue);

    background: rgba(255, 255, 255, 0.75);

    transform: translateY(-1px);
}


/* Active portal */

.portal-tab.active {
    color: var(--neon-blue);

    background: #ffffff;

    box-shadow:
        0 3px 12px rgba(15, 23, 42, 0.08);

    border: 1px solid rgba(37, 99, 235, 0.10);
}


/* SAT active when used on SAT dashboard */

.sat-portal-active .portal-tab#satPortalTab,
body.sat-dashboard .portal-tab#satPortalTab {
    color: var(--neon-blue);

    background: #ffffff;

    box-shadow:
        0 3px 12px rgba(15, 23, 42, 0.08);

    border: 1px solid rgba(37, 99, 235, 0.10);
}


/* =========================================================
   NAVIGATION
   ========================================================= */

.sidebar-nav {
    display: flex;
    flex-direction: column;

    width: 100%;

    flex: 1;

    min-height: 0;
}


/* =========================================================
   MENU ITEM
   ========================================================= */

.menu-item {
    display: flex;
    align-items: center;

    width: 100%;

    box-sizing: border-box;

    padding: 11px 11px;

    margin: 4px 0;

    border-radius: 11px;

    color: #000000;

    text-decoration: none;

    font-weight: 600;
    font-size: 0.93rem;

    letter-spacing: 0.1px;

    transition:
        transform 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;

    position: relative;

    overflow: hidden;

    border: 1px solid transparent;
}


/* Menu icon */

.menu-item i {
    width: 30px;

    min-width: 30px;

    margin-right: 9px;

    text-align: center;

    color: var(--neon-blue);

    font-size: 1.05rem;

    transition: transform 0.18s ease;
}


/* Menu text */

.menu-item span {
    white-space: nowrap;
}


/* Hover sweep */

.menu-item::before {
    content: '';

    position: absolute;

    inset: 0;

    transform: translateX(-120%);

    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(37, 99, 235, 0.10) 45%,
        transparent 100%
    );

    transition: transform 0.6s ease;
}


.menu-item:hover::before {
    transform: translateX(120%);
}


/* Hover */

.menu-item:hover {
    background: rgba(37, 99, 235, 0.06);

    border-color: rgba(37, 99, 235, 0.12);

    transform: translateX(2px);
}


.menu-item:hover i {
    transform: scale(1.05);
}


/* Active */

.menu-item.active {
    background: rgba(37, 99, 235, 0.10);

    border: 1px solid rgba(37, 99, 235, 0.18);

    box-shadow:
        0 8px 20px rgba(37, 99, 235, 0.08);

    border-left: 4px solid var(--neon-blue);

    padding-left: 8px;
}


/* =========================================================
   SIDEBAR BOTTOM
   ========================================================= */

.sidebar-bottom {
    width: 100%;

    margin-top: auto;

    padding-top: 12px;

    flex-shrink: 0;

    border-top: 1px solid rgba(37, 99, 235, 0.10);
}


/* =========================================================
   SIDEBAR USER
   ========================================================= */

.sidebar-user {
    width: 100%;

    box-sizing: border-box;

    position: relative;

    display: flex;
    align-items: center;

    justify-content: space-between;

    gap: 8px;

    padding: 9px;

    margin-bottom: 5px;

    border-radius: 12px;

    cursor: pointer;

    border: 1px solid transparent;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.15s ease;
}


.sidebar-user:hover {
    background: rgba(37, 99, 235, 0.06);

    border-color: rgba(37, 99, 235, 0.10);

    transform: translateY(-1px);
}


/* User main area */

.sidebar-user-main {
    display: flex;

    align-items: center;

    gap: 9px;

    min-width: 0;
}


/* =========================================================
   USER AVATAR
   ========================================================= */

.user-avatar {
    width: 34px;
    height: 34px;

    min-width: 34px;

    border-radius: 50%;

    background:
        linear-gradient(
            45deg,
            var(--neon-blue),
            var(--electric-purple)
        );

    display: flex;

    align-items: center;
    justify-content: center;

    font-weight: 900;

    letter-spacing: 0.3px;

    color: #ffffff;

    font-size: 0.80rem;

    position: relative;

    box-shadow:
        0 5px 14px rgba(37, 99, 235, 0.18);
}


/* Online dot */

.online-status {
    position: absolute;

    width: 8px;
    height: 8px;

    right: 0;
    bottom: 1px;

    border-radius: 50%;

    background: #22c55e;

    border: 2px solid #ffffff;

    box-sizing: content-box;
}


/* =========================================================
   USER META
   ========================================================= */

.sidebar-user .user-meta {
    min-width: 0;

    flex: 1;
}


.sidebar-user .user-name {
    font-size: 0.84rem;

    color: var(--star-dust);

    line-height: 1.2;

    font-weight: 800;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}


.sidebar-user .user-role {
    font-size: 0.72rem;

    color: rgba(37, 99, 235, 0.92);

    font-weight: 800;

    margin-top: 2px;
}


/* =========================================================
   USER DROPDOWN ICON
   ========================================================= */

.sidebar-user .dropdown-icon {
    color: rgba(15, 23, 42, 0.65);

    transition: transform 0.2s ease;

    flex-shrink: 0;
}


.sidebar-user .dropdown-icon i {
    font-size: 0.72rem;
}


/* Rotate when opened */

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


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

.sidebar-user .dropdown-menu {
    display: none;

    position: absolute;

    left: 0;

    bottom: calc(100% + 8px);

    top: auto;

    width: 100%;

    min-width: 190px;

    box-sizing: border-box;

    background: #ffffff;

    box-shadow:
        0 16px 40px rgba(15, 23, 42, 0.14);

    border-radius: 13px;

    overflow: hidden;

    z-index: 1100;

    border: 1px solid rgba(37, 99, 235, 0.14);

    animation: none;
}


/* Open */

.sidebar-user .dropdown-menu.active {
    display: block;

    animation: sidebarDropdownIn 0.18s ease-out;
}


@keyframes sidebarDropdownIn {
    from {
        opacity: 0;

        transform: translateY(6px);
    }

    to {
        opacity: 1;

        transform: translateY(0);
    }
}


/* Dropdown list */

.sidebar-user .dropdown-menu ul {
    list-style: none;

    margin: 0;

    padding: 6px 0;
}


.sidebar-user .dropdown-menu ul li {
    padding: 0;

    transition: background 0.2s ease;
}


.sidebar-user .dropdown-menu ul li:not(:last-child) {
    border-bottom:
        1px solid rgba(37, 99, 235, 0.07);
}


.sidebar-user .dropdown-menu ul li a {
    color: var(--star-dust);

    text-decoration: none;

    font-size: 0.82rem;

    font-weight: 650;

    display: flex;

    align-items: center;

    gap: 10px;

    padding: 10px 13px;

    width: 100%;

    box-sizing: border-box;
}


.sidebar-user .dropdown-menu ul li a i {
    width: 18px;

    color: var(--neon-blue);

    text-align: center;
}


.sidebar-user .dropdown-menu ul li:hover {
    background: rgba(37, 99, 235, 0.06);
}


/* =========================================================
   BOTTOM SIGN OUT
   ========================================================= */

.sidebar-signout {
    margin: 3px 0 0;

    color: #475569;
}


.sidebar-signout i {
    color: #64748b;
}


.sidebar-signout:hover {
    color: #dc2626;

    background: rgba(220, 38, 38, 0.05);

    border-color: rgba(220, 38, 38, 0.08);
}


.sidebar-signout:hover i {
    color: #dc2626;
}


/* =========================================================
   HEADER
   ========================================================= */

.header {
    grid-column: 2 / 3;
    grid-row: 1 / 2;

    background: rgba(255, 255, 255, 0.94);

    border-bottom:
        1px solid rgba(37, 99, 235, 0.12);

    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);

    position: sticky;

    top: 0;

    z-index: 500;

    padding: 8px 12px;

    min-height: 44px;

    box-sizing: border-box;

    gap: 10px;

    display: grid;

    grid-template-columns: auto 1fr;

    align-items: center;

    margin-left: 40px;
}


/* =========================================================
   MENU TOGGLE
   ========================================================= */

.menu-toggle {
    background: transparent;

    border:
        1px solid rgba(37, 99, 235, 0.12);

    color: var(--star-dust);

    width: 44px;
    height: 44px;

    border-radius: 10px;

    display: flex;

    align-items: center;
    justify-content: center;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.15s ease;
}


.menu-toggle i {
    font-size: 1.35rem;
}


.menu-toggle:hover {
    background: rgba(37, 99, 235, 0.08);

    border-color:
        rgba(37, 99, 235, 0.18);

    transform: translateY(-1px);
}


/* =========================================================
   HEADER TOOLS
   ========================================================= */

.header-tools {
    display: flex;

    align-items: center;

    justify-content: flex-end;

    gap: 8px;

    flex-wrap: nowrap;

    margin-right: 8px;
}


/* =========================================================
   STREAK + COINS
   ========================================================= */

.header-pill {
    height: 34px;

    padding: 0 10px;

    border-radius: 999px;

    border:
        1px solid rgba(37, 99, 235, 0.14);

    background:
        rgba(15, 23, 42, 0.02);

    display: flex;

    align-items: center;

    gap: 8px;

    font-weight: 850;

    font-size: 0.84rem;

    color: var(--star-dust);

    white-space: nowrap;
}


.header-pill i {
    font-size: 0.92rem;
}


/* Streak */

.header-pill.streak i {
    color: var(--amber);
}


.header-pill.streak b {
    color: var(--cosmic-blue);

    font-weight: 900;
}


/* Coins */

.header-pill.coin i {
    color: var(--cyber-pink);
}


.header-pill.coin b {
    color: var(--cosmic-blue);

    font-weight: 900;
}


/* =========================================================
   UPGRADE BUTTON
   ========================================================= */

.upgrade-btn {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 6px;

    padding: 6px 10px;

    border-radius: 999px;

    text-decoration: none;

    font-weight: 800;

    font-size: 0.82rem;

    color: #ffffff;

    background:
        linear-gradient(
            90deg,
            var(--neon-blue),
            var(--electric-purple)
        );

    border:
        1px solid rgba(37, 99, 235, 0.18);

    white-space: nowrap;

    transition:
        transform 0.15s ease,
        filter 0.2s ease;
}


.upgrade-btn i {
    font-size: 0.92rem;
}


.upgrade-btn:hover {
    transform: translateY(-1px);

    filter: saturate(1.05);
}


/* =========================================================
   NOTIFICATION
   ========================================================= */

.notification-link {
    display: flex;

    align-items: center;
    justify-content: center;

    text-decoration: none;
}


.notification-btn {
    background: transparent;

    border:
        1px solid rgba(37, 99, 235, 0.12);

    color: var(--star-dust);

    width: 34px;
    height: 34px;

    border-radius: 10px;

    display: flex;

    align-items: center;
    justify-content: center;

    cursor: pointer;

    position: relative;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.15s ease;
}


.notification-btn i {
    font-size: 0.95rem;
}


.notification-btn:hover {
    background: rgba(37, 99, 235, 0.08);

    border-color:
        rgba(37, 99, 235, 0.18);

    transform: translateY(-1px);
}


/* Notification badge */

.notification-badge {
    position: absolute;

    top: -6px;
    right: -6px;

    background: var(--cyber-pink);

    color: #ffffff;

    padding: 2px 6px;

    border-radius: 999px;

    font-size: 0.62rem;

    font-weight: 900;

    border: 2px solid #ffffff;

    box-shadow:
        0 10px 18px rgba(249, 115, 22, 0.18);
}


/* =========================================================
   MAIN CONTENT
   ========================================================= */

.main-content {
    grid-column: 2 / 3;
    grid-row: 2 / 3;

    margin-top: 0;

    padding: 20px;

    display: grid;

    grid-template-columns:
        repeat(auto-fit, minmax(280px, 1fr));

    gap: 20px;

    position: relative;

    margin-left: 50px;

    margin-right: 30px;
}


/* =========================================================
   LINKS
   ========================================================= */

a {
    text-decoration: none;

    color: inherit;
}


a:hover {
    color: inherit;
}


/* =========================================================
   MOBILE / TABLET
   ========================================================= */

@media (max-width: 1200px) {

    .dashboard-container {
        grid-template-columns: 1fr;
    }


    /* Sidebar becomes off-canvas */

    .sidebar {
        transform: translateX(-100%);

        z-index: 1001;

        width: 220px;

        height: 100vh;
    }


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


    /* Header full width */

    .header {
        margin-left: 0;

        grid-column: 1;

        padding: 8px 10px;

        min-height: 44px;
    }


    /* Main */

    .main-content {
        margin-left: 30px;

        grid-column: 1;

        padding: 15px;

        margin-top: 20px;
    }


    .menu-toggle {
        width: 42px;
        height: 42px;
    }


    .menu-toggle i {
        font-size: 1.3rem;
    }


    .header-tools {
        gap: 7px;
    }


    .notification-btn {
        width: 32px;
        height: 32px;
    }


    .header-pill {
        height: 32px;

        padding: 0 9px;

        font-size: 0.82rem;
    }
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 768px) {

    .header {
        padding: 7px 9px;

        min-height: 42px;
    }


    .header-tools {
        gap: 6px;
    }


    .header-pill {
        height: 31px;

        padding: 0 8px;

        gap: 6px;
    }


    .upgrade-btn {
        padding: 6px 9px;
    }


    .notification-btn {
        width: 31px;
        height: 31px;
    }


    .main-content {
        margin-left: 20px;

        margin-right: 20px;
    }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 640px) {

    .header {
        padding: 7px 8px;

        min-height: 42px;

        gap: 7px;
    }


    .menu-toggle {
        width: 40px;
        height: 40px;
    }


    .menu-toggle i {
        font-size: 1.2rem;
    }


    .header-tools {
        gap: 5px;

        margin-right: 0;
    }


    /* Hide labels on mobile */

    .header-pill .pill-label {
        display: none;
    }


    .header-pill {
        height: 30px;

        padding: 0 8px;

        gap: 5px;

        font-size: 0.80rem;
    }


    .header-pill i {
        font-size: 0.86rem;
    }


    /* Upgrade icon only */

    .upgrade-btn {
        width: 31px;
        height: 30px;

        padding: 0;

        border-radius: 9px;
    }


    .upgrade-btn span {
        display: none;
    }


    .upgrade-btn i {
        font-size: 0.85rem;
    }


    .notification-btn {
        width: 30px;
        height: 30px;

        border-radius: 9px;
    }


    .notification-btn i {
        font-size: 0.86rem;
    }


    /* Sidebar */

    .sidebar {
        width: 220px;
    }


    .portal-tab {
        font-size: 0.80rem;
    }


    /* Main */

    .main-content {
        margin-left: 10px;

        margin-right: 10px;

        padding: 12px;
    }
}


/* =========================================================
   SMALL PHONE
   ========================================================= */

@media (max-width: 420px) {

    .header {
        padding-left: 6px;
        padding-right: 6px;
    }


    .header-tools {
        gap: 4px;
    }


    .header-pill {
        padding: 0 7px;
    }


    .notification-btn {
        width: 29px;
        height: 29px;
    }


    .upgrade-btn {
        width: 30px;
        height: 29px;
    }
}


/* =========================================================
   VERY SMALL PHONE
   ========================================================= */

@media (max-width: 360px) {

    .header-tools {
        gap: 3px;
    }


    .header-pill {
        padding: 0 6px;
    }


    .menu-toggle {
        width: 38px;
        height: 38px;
    }
}