/* --- VARIABLES & RESET --- */
:root {
    --primary-color: #41D185;
    --secondary-color: #36C690;
    --bg-light: #F5F9FC;
    --text-dark: #1F2937;
    --text-grey: #9CA3AF;
    --white: #FFFFFF;
    --sidebar-width: 260px;
    --right-panel-width: 320px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.5;
    min-height: 100vh;
}

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

li {
    list-style: none;
}

/* --- LAYOUT --- */
.app-container {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr var(--right-panel-width);
    min-height: 100vh;
}

@media (max-width: 1200px) {
    .app-container {
        grid-template-columns: var(--sidebar-width) 1fr;
    }
    .right-panel {
        display: none; /* Hide right panel on smaller desktops/tablets */
    }
}

@media (max-width: 1024px) {
    .app-container {
        display: block; /* Stack everything on mobile/tablets */
    }
    .sidebar {
        display: none; /* Hidden by default on mobile, shown via toggle */
    }
}

/* --- LEFT SIDEBAR --- */
.sidebar {
    background: var(--white);
    padding: 30px;
    display: flex;
    flex-direction: column;
}

.sidebar-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 32px;
}

.logo-box {
    width: 56px;
    height: 56px;
    background: var(--primary-color);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    color: white;
    font-size: 28px;
    margin-bottom: 8px;
}

.sidebar-logo .brand { font-weight: 700; font-size: 16px; }
.sidebar-logo .tagline { font-size: 11px; color: var(--text-grey); }

.menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-grey);
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
    cursor: pointer;
}

.nav-item:hover { background: #E6F9F0; color: var(--primary-color); }
.nav-item.active { background: #E6F9F0; color: var(--primary-color); font-weight: 700; }
.nav-icon { font-size: 18px; width: 22px; text-align: center; }
.upgrade-card {
    background: #E8FDF3;
    padding: 20px;
    border-radius: 20px;
    text-align: center;
    position: relative;
}

.upgrade-img {
    width: 60px;
    margin-top: -40px;
    margin-bottom: 10px;
}

.upgrade-card p {
    font-size: 12px;
    margin-bottom: 15px;
    color: #555;
}

.btn-upgrade {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.sidebar-footer {
    margin-top: auto;
}

/* --- MAIN CONTENT & HEADER --- */
.main-content {
    padding: 30px 40px;
    background: var(--bg-light);
    min-height: 100vh;
}

@media (max-width: 768px) {
    .main-content {
        padding: 20px;
    }
}

/* --- TOP HEADER (Shared across pages) --- */
.top-header {
    padding: 30px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-light);
    position: sticky;
    top: 0;
    z-index: 900;
    gap: 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

@media (max-width: 1024px) {
    .top-header {
        padding: 20px;
        z-index: 1001; /* Above toggle if needed */
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .top-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
        padding-top: 50px; /* Space for fixed burger menu */
    }
}

/* --- SEARCH BAR (Shared across pages) --- */
.search-container {
    flex: 1;
    max-width: 450px;
}

@media (max-width: 768px) {
    .search-container {
        width: 100%;
        max-width: 100%;
    }
}

.search-bar {
    background: var(--white);
    padding: 12px 25px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    width: 100%;
}

.search-bar:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 4px 20px rgba(65, 209, 133, 0.15);
}

.search-bar input {
    border: none;
    outline: none;
}

.search-bar:focus-within input,
.search-bar:hover input {
    width: 100%;
    opacity: 1;
    margin-right: 10px;
}

/* --- COMMON COMPONENTS (TABS, CARDS, PROGRESS) --- */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.tabs span {
    margin-left: 15px;
    font-size: 14px;
    color: var(--text-grey);
    cursor: pointer;
}

.tabs span.active {
    color: var(--primary-color);
    font-weight: 600;
}

.course-card {
    background: var(--white);
    padding: 20px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.course-card .icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.icon.orange { background: #FFB347; }
.icon.blue { background: #00A8E8; }

.course-info {
    flex: 0 0 250px;
    margin-left: 15px;
}

.course-info h4 {
    font-size: 15px;
    margin-bottom: 4px;
}

.course-info p {
    font-size: 12px;
    color: var(--text-grey);
}

.progress-wrapper {
    flex: 1;
    margin-right: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.progress-bar {
    width: 80%;
    height: 6px;
    background: #EEE;
    border-radius: 10px;
    margin-top: 5px;
    overflow: hidden;
}

.progress-bar .fill {
    height: 100%;
    background: var(--primary-color);
}

.rating {
    color: #FFB347;
    font-weight: 600;
    margin-right: 40px;
}

.btn-view {
    padding: 8px 16px;
    border: 1px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
}

/* --- RIGHT PANEL (COMMON HEADER) --- */
.right-panel {
    background: var(--white);
    padding: 30px;
    border-left: 1px solid #EEE;
}

.profile-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
}

.user-info img {
    border-radius: 50%;
}

/* --- LAYOUT VARIATIONS --- */
body.chat-page .app-container {
    grid-template-columns: var(--sidebar-width) 320px 1fr;
}

body.profile-page .app-container {
    grid-template-columns: var(--sidebar-width) 350px 1fr;
}

body.full-width-page .app-container {
    grid-template-columns: var(--sidebar-width) 1fr;
}

@media (max-width: 1024px) {
    body.full-width-page .app-container {
        display: block;
    }
}

body.full-width-page .main-content {
    padding-right: 40px;
}

.back-button {
    font-size: 24px;
    color: var(--text-dark);
    margin-right: 20px;
    cursor: pointer;
}

/* Schedule page: sidebar + main + right panel */
body.schedule-page .app-container {
    grid-template-columns: var(--sidebar-width) 1fr var(--right-panel-width);
}

/* Resources page layout (if needed) */
body.resources-page .app-container {
    grid-template-columns: var(--sidebar-width) 1fr;
}

/* Courses-detail: no right panel, sidebar + two column content */
body.courses-detail-page .app-container {
    grid-template-columns: var(--sidebar-width) 1fr;
}

/* --- GLOBAL HEADER RIGHT WIDGET --- */
.header-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 25px;
}

.notification-btn-wrapper {
    position: relative;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.notification-btn-wrapper:hover {
    background: rgba(0, 0, 0, 0.05);
}

.notification-btn-wrapper i {
    font-size: 22px;
    color: var(--text-grey);
}

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

.user-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.user-header img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.dropdown-icon {
    font-size: 10px;
    margin-left: 5px;
    color: var(--text-grey);
}

.user-dropdown-menu {
    position: absolute;
    top: 120%;
    right: 0;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    width: 200px;
    padding: 10px 0;
    display: none;
    flex-direction: column;
    z-index: 1000;
}

.user-dropdown-menu.show {
    display: flex;
}

.user-dropdown-menu .dropdown-item {
    padding: 10px 20px;
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s;
}

.user-dropdown-menu .dropdown-item:hover {
    background: #f5f9fc;
    color: var(--primary-color);
}

.user-dropdown-menu .dropdown-item i {
    width: 16px;
    text-align: center;
}
