:root {
    /* Основные цвета */
    --color-primary: #667eea;
    --color-primary-hover: #5a67d8;
    --color-secondary: #764ba2;
    --color-success: #48bb78;
    --color-danger: #f56565;
    --color-warning: #ed8936;
    --color-info: #4299e1;

    /* Фон */
    --bg-primary: #f7fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #edf2f7;
    --bg-hover: #e2e8f0;

    /* Текст */
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-muted: #a0aec0;

    /* Границы */
    --border-color: #e2e8f0;

    /* Тени */
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] {
    --color-primary: #7c3aed;
    --color-primary-hover: #6d28d9;
    --color-secondary: #8b5cf6;
    --color-success: #10b981;
    --color-danger: #ef4444;
    --color-warning: #f59e0b;
    --color-info: #3b82f6;

    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-hover: #475569;

    --text-primary: #f1f5f9;
    --text-secondary: #e2e8f0;
    --text-muted: #94a3b8;

    --border-color: #334155;

    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.5);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

img {
    display: block;
    margin-inline: auto;
    width: 90%;
    max-width: 100%;
}

/* Header */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
}

.logo {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.user-menu:hover {
    background: var(--bg-tertiary);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: white;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.topic-container {
    max-width: 900px;
}

/* Welcome Section */
.welcome-section {
    margin-bottom: 40px;
}

.welcome-section h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 18px;
    color: var(--text-secondary);
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border: 4px solid var(--bg-tertiary);
    border-top: 4px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-small {
    width: 30px;
    height: 30px;
    margin: 0 auto 10px;
    border: 3px solid var(--bg-tertiary);
    border-top: 3px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-state p {
    color: var(--text-muted);
}

/* Error State */
.error-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-secondary);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
}

.error-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.error-state h3 {
    font-size: 24px;
    color: var(--color-danger);
    margin-bottom: 10px;
}

.error-state p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Directions Grid */
.directions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.direction-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.direction-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary);
}

.direction-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.direction-info h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.direction-description {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.direction-progress {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 45px;
}

/* Layout */
.layout {
    display: flex;
    min-height: calc(100vh - 80px);
}

.sidebar {
    width: 320px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 30px;
    overflow-y: auto;
}

.course-header {
    margin-bottom: 30px;
}

.course-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.course-progress {
    margin-bottom: 20px;
}

.progress-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
}

/* Topics List */
.topics-list {
    list-style: none;
}

.topic-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: background 0.2s ease;
    cursor: pointer;
}

.topic-item:hover {
    background: var(--bg-hover);
}

.topic-item.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.topic-item.completed {
    opacity: 0.65;
    filter: grayscale(20%);
}

.topic-item.completed:hover {
    opacity: 0.85;
    filter: grayscale(0%);
}

.topic-item.completed .topic-title {
    color: var(--text-muted);
    text-decoration: line-through;
    text-decoration-thickness: 1px;
}

.topic-item.completed .topic-duration {
    color: var(--text-muted);
}

.topic-status {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.topic-item.completed .topic-status {
    background: var(--color-success);
    color: white;
    font-size: 16px;
}

.topic-item.active .topic-status {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: white;
}

.topic-item:not(.completed):not(.active) .topic-status {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.topic-info {
    flex: 1;
}

.topic-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.topic-duration {
    font-size: 12px;
    color: var(--text-muted);
}

/* Content */
.content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 30px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.back-button:hover {
    color: var(--color-primary);
}

.welcome-card {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: white;
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
}

.welcome-card h2 {
    font-size: 28px;
    margin-bottom: 10px;
}

.welcome-card p {
    font-size: 16px;
    opacity: 0.95;
    line-height: 1.8;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.btn-start {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.btn-start:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Topic Page */
.topic-header {
    margin-bottom: 40px;
}

.topic-header .topic-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 10px;
}

.topic-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    color: var(--text-muted);
    font-size: 14px;
}

.content-section {
    background: var(--bg-secondary);
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
}

.content-section h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.content-section h3 {
    font-size: 20px;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.content-section p {
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.content-section ul, .content-section ol {
    margin-left: 24px;
    margin-bottom: 16px;
}

.content-section li {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.practice-task {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid var(--color-warning);
}

.practice-task h3 {
    margin-top: 0;
    color: var(--color-warning);
}

.ai-interview {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border: 2px solid var(--color-primary);
}

.ai-interview h2 {
    color: var(--color-primary);
}

/* Buttons */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-hover);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.actions {
    display: flex;
    gap: 16px;
    margin-top: 40px;
    flex-wrap: wrap;
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: var(--shadow-lg);
}

/* Header Enhancements */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 32px;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    cursor: pointer;
}

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

.nav-item {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--bg-tertiary);
    color: var(--color-primary);
    font-weight: 600;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
}

/* Page Layout */
.page-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 16px;
    margin-bottom: 40px;
}

/* Direction Card (Dashboard version) */
.direction-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 32px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.direction-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary);
}

.direction-card.clickable {
    cursor: pointer;
}

.direction-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.direction-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.direction-info h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
}

.direction-subtitle {
    color: var(--text-muted);
    font-size: 14px;
}

.direction-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-primary);
}

.progress-section {
    margin-bottom: 24px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.progress-bar {
    height: 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    transition: width 0.3s ease;
}

.btn-continue {
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-continue:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(124, 58, 237, 0.4);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-md);
}

.stat-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-card-title {
    font-size: 14px;
    color: var(--text-muted);
}

.stat-card-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Profile Page */
.profile-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.profile-info h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(124, 58, 237, 0.2);
    border: 1px solid var(--color-primary);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-primary);
}

.info-section {
    margin-bottom: 32px;
}

.info-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.info-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    width: 180px;
    color: var(--text-muted);
    font-size: 14px;
    flex-shrink: 0;
}

.info-value {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

.btn-danger {
    background: transparent;
    border: 2px solid var(--color-danger);
    color: var(--color-danger);
    width: 100%;
    height: 48px;
}

.btn-danger:hover {
    background: var(--color-danger);
    color: white;
}

/* Placeholder Pages */
.placeholder-body {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.placeholder-container {
    max-width: 600px;
    width: 100%;
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 48px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.icon {
    font-size: 80px;
    margin-bottom: 24px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.placeholder-container h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.placeholder-container p {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 32px;
}

.features {
    text-align: left;
    margin-bottom: 32px;
    padding: 24px;
    background: var(--bg-primary);
    border-radius: 12px;
}

.features h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.features ul {
    list-style: none;
}

.features li {
    padding: 8px 0;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.features li::before {
    content: "✓";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    font-weight: bold;
    flex-shrink: 0;
}

.status {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(237, 137, 54, 0.2);
    color: #ed8936;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 24px;
}

/* Responsive */
@media (max-width: 768px) {
    .header-left {
        gap: 16px;
    }

    .nav-menu {
        display: none;
    }

    .layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .content {
        padding: 20px;
    }

    .directions-grid {
        grid-template-columns: 1fr;
    }

    .direction-stats {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .info-row {
        flex-direction: column;
        gap: 4px;
    }

    .info-label {
        width: 100%;
    }

    .messenger-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        max-height: 300px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .message {
        max-width: 85%;
    }

    .nav-menu {
        display: none;
    }
}

/* ========== MESSENGER STYLES ========== */

body.messenger-body {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.messenger-container {
    display: flex;
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    background: var(--bg-secondary);
    overflow: hidden;
}

/* Sidebar with mentors list */
.sidebar {
    width: 320px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
    font-size: 20px;
    margin-bottom: 12px;
}

.sidebar-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.sidebar-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

.search-box {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.search-box:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.mentors-list {
    flex: 1;
    overflow-y: auto;
}

.mentor-item {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.mentor-item:hover {
    background: var(--bg-primary);
}

.mentor-item.active {
    background: rgba(102, 126, 234, 0.1);
    border-left: 3px solid var(--color-primary);
}

.mentor-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-info) 0%, var(--color-primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    font-weight: 600;
    flex-shrink: 0;
    position: relative;
}

.online-indicator {
    width: 12px;
    height: 12px;
    background: var(--color-success);
    border: 2px solid white;
    border-radius: 50%;
    position: absolute;
    bottom: 0;
    right: 0;
}

.offline-indicator {
    background: var(--text-muted);
}

.mentor-info {
    flex: 1;
    min-width: 0;
}

.mentor-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
}

.mentor-specialty {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.last-message {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 4px;
}

.message-time {
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.unread-badge {
    width: 20px;
    height: 20px;
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

/* Chat area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
}

.chat-header {
    padding: 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header-info {
    flex: 1;
}

.chat-header-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.chat-header-status {
    font-size: 13px;
    color: var(--text-secondary);
}

.chat-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-primary);
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: var(--border-color);
    transform: scale(1.05);
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    display: flex;
    gap: 10px;
    max-width: 70%;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.sent {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-info) 0%, var(--color-primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.message-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    word-wrap: break-word;
}

.message.sent .message-bubble {
    background: var(--color-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.received .message-bubble {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.message-meta {
    font-size: 11px;
    color: var(--text-muted);
    padding: 0 4px;
}

.message.sent .message-meta {
    text-align: right;
}

.date-separator {
    text-align: center;
    margin: 16px 0;
    position: relative;
}

.date-separator span {
    background: var(--bg-primary);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

.input-area {
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.input-wrapper {
    flex: 1;
    position: relative;
}

.message-input {
    width: 100%;
    padding: 12px 50px 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    resize: none;
    max-height: 120px;
    transition: all 0.3s ease;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.message-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.attach-btn {
    position: absolute;
    right: 12px;
    bottom: 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.attach-btn:hover {
    opacity: 1;
}

.send-btn {
    width: 48px;
    height: 48px;
    border: none;
    background: linear-gradient(135deg, var(--color-info) 0%, var(--color-primary) 100%);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 14px;
}

/* ========== NEW HEADER STYLES ========== */

.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 32px;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    cursor: pointer;
}

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

.nav-item {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--bg-tertiary);
    color: var(--color-primary);
    font-weight: 600;
}

.user-avatar,
.user-avatar-header {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.user-avatar-header {
    width: 36px;
    height: 36px;
    font-size: 14px;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.user-menu:hover {
    background: var(--bg-tertiary);
}

/* ========== MODULES GRID ========== */

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.module-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    position: relative;
}

.module-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary);
}

.module-card.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.module-card.locked:hover {
    transform: none;
    box-shadow: var(--shadow-md);
}

.lock-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
}

.module-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.module-info h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.module-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.module-progress {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.progress-info {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 24px;
}

.progress-text {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

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

/* ========== WELCOME CARD (Topics page) ========== */

.welcome-icon {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin-bottom: 24px;
}

.stat-box {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.stat-box-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 4px;
}

.stat-box-label {
    font-size: 13px;
    color: var(--text-muted);
}

/* ========== TOPIC PAGE ========== */

.topic-description {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.content-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
}

.content-card h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 16px;
}

.content-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 24px 0 12px;
    color: var(--color-primary);
}

.content-card p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 16px;
}

.content-card ul {
    margin-left: 24px;
    margin-bottom: 16px;
}

.content-card li {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 8px;
}

.action-buttons {
    display: flex;
    gap: 16px;
    margin-top: 32px;
}

/* ========== MENTOR CONTACT ========== */

.mentor-contact {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-top: 32px;
    box-shadow: var(--shadow-md);
}

.mentor-contact-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.mentor-contact-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--color-warning) 0%, #dd6b20 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.mentor-contact h3 {
    font-size: 18px;
    font-weight: 600;
}

.mentor-contact p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.6;
}

.feedback-form textarea {
    width: 100%;
    min-height: 100px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 12px;
}

.feedback-form textarea:focus {
    outline: none;
    border-color: var(--color-primary);
}

.feedback-form textarea::placeholder {
    color: var(--text-muted);
}

.btn-mentor {
    width: 100%;
    height: 44px;
    background: linear-gradient(135deg, var(--color-warning) 0%, #dd6b20 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-mentor:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4);
}

/* ========== DIRECTION CONTENT (Profile) ========== */

.direction-content {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.direction-details h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.direction-progress {
    font-size: 14px;
    color: var(--text-muted);
}

