﻿/* ===================== AIDA212 v2 - LOGO & LAYOUT STYLES ===================== */

.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    transition: width 0.3s ease;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 4px 0 0;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0 !important;
    flex: 1;
    min-width: 0;
}

.sidebar-logo .logo-img,
.sidebar-logo img {
    width: 110px !important;
    height: 110px !important;
    max-width: none !important;
    flex-shrink: 0;
    margin: -8px -14px -8px -8px !important;
    padding: 0 !important;
    filter: drop-shadow(0 0 18px rgba(67, 97, 238, 0.35));
    transition: filter 0.3s ease;
}

.sidebar-logo .logo-img:hover,
.sidebar-logo img:hover {
    filter: drop-shadow(0 0 32px rgba(67, 97, 238, 0.55));
}

.logo-text {
    font-size: 26px;
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    line-height: 1.1;
    margin-left: -10px;
}

.company-name {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 1px;
    margin-left: -10px;
    letter-spacing: 0.3px;
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .sidebar-company,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .user-info-sm > div:not(.user-avatar),
.sidebar.collapsed .sidebar-toggle {
    display: none;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 10px;
}

.sidebar.collapsed .sidebar-logo {
    justify-content: center;
}

.sidebar-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-primary);
    border: none;
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
    z-index: 5;
}

.sidebar-toggle:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.sidebar-company {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.company-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.company-badge i {
    font-size: 10px;
    color: var(--accent-primary);
}

.sidebar-nav {
    flex: 1;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

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

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(67, 97, 238, 0.15);
    color: #818cf8;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.sidebar-footer {
    padding: 12px 8px;
    border-top: 1px solid var(--border-color);
}

.user-info-sm {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius-md);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

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

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

/* Dashboard - styles moved to main.css */
/* Client Types Grid - styles moved to main.css */
/* Level Badge - styles moved to main.css */
/* Difficulty Selector - styles moved to main.css */
/* Empty State - styles moved to main.css */

/* Rating */
.rating-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
}

.rating-item:last-child {
    border-bottom: none;
}

.rating-item-me {
    background: rgba(67, 97, 238, 0.08);
    border-radius: var(--radius-md);
}

.rating-position {
    font-size: 20px;
    font-weight: 700;
    width: 40px;
    text-align: center;
}

.rating-user {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.rating-detail {
    font-size: 11px;
    color: var(--text-muted);
}

.rating-xp {
    text-align: right;
}

.xp-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--accent-primary);
}

.xp-label {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
}

/* Achievements */
.achievements-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.achievement-stat {
    text-align: center;
}

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

.achievement-stat .stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.achievements-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.achievement-category {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.category-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.achievement-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.achievement-item.locked { opacity: 0.6; }
.achievement-item.unlocked { opacity: 1; border-color: rgba(67, 97, 238, 0.3); }

.achievement-icon {
    width: 36px;
    height: 36px;
    background: var(--bg-secondary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 16px;
    flex-shrink: 0;
}

.achievement-item.unlocked .achievement-icon {
    background: rgba(67, 97, 238, 0.15);
    color: #818cf8;
}

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

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

.achievement-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

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

.achievement-item.unlocked .achievement-status { color: #22c55e; }

/* Page title */
.page-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 12px;
}

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

/* Trainer */
.trainer-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.trainer-header {
    margin-bottom: 24px;
}

.trainer-selection {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 24px;
}

.trainer-layout {
    display: flex;
    height: calc(100vh - 140px);
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.trainer-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* History panel */
.history-panel {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
    flex-shrink: 0;
}

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

.history-header h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.history-item {
    padding: 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

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

.history-item.active {
    background: rgba(67, 97, 238, 0.1);
    border: 1px solid rgba(67, 97, 238, 0.2);
}

.history-item-type {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.history-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.history-item-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.history-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-muted);
    font-size: 13px;
}

.history-empty i {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* Mode toggle */
.mode-toggle {
    display: flex;
    gap: 4px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 3px;
    margin-bottom: 12px;
}

.mode-btn {
    flex: 1;
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.mode-btn:hover { color: var(--text-secondary); }
.mode-btn.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.mode-btn i { font-size: 14px; }

/* Footer */
.app-footer {
    text-align: center;
    padding: 24px 32px 16px;
    border-top: 1px solid var(--border-color);
    margin-top: 48px;
}

.app-footer p {
    color: #334155;
    font-size: 12px;
    letter-spacing: 0.3px;
}

.app-footer strong {
    color: #475569;
    font-weight: 600;
}

/* Chat header */
.chat-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border-light);
}

.auth-divider span {
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Modal close btn */
.modal-close-btn {
    width: 32px !important;
    height: 32px !important;
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-light) !important;
    border-radius: 8px !important;
    color: var(--text-muted) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    font-size: 14px !important;
    padding: 0 !important;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: var(--bg-card) !important;
    border-color: var(--accent-primary) !important;
    color: var(--text-primary) !important;
}

/* Trainer button */
.btn-trainer {
    width: 100%;
    padding: 12px;
    margin-top: 8px;
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-trainer:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(67, 97, 238, 0.05);
}

/* Trainer modal */
#trainerModal .modal-header {
    border-bottom-color: rgba(245, 158, 11, 0.2);
}

#trainerModal .modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #f59e0b;
}

.trainer-hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 16px;
    padding: 12px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.15);
    border-radius: var(--radius-md);
}

.trainer-hint i {
    color: #f59e0b;
    font-size: 14px;
    margin-top: 2px;
    flex-shrink: 0;
}

.trainer-hint span {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
}

/* Voice button */
.voice-btn {
    animation: voicePulse 2s ease-in-out infinite;
}

@keyframes voicePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(67, 97, 238, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(67, 97, 238, 0); }
}

/* ===== History Page ===== */
.history-header-page {
    margin-bottom: 24px;
}

.history-list-full {
    display: flex;
    flex-direction: column;
}

.history-item-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
    cursor: pointer;
}

.history-item-card:last-child {
    border-bottom: none;
}

.history-item-card:hover {
    background: var(--bg-secondary);
}

.history-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.history-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.history-item-info {}

.history-item-right {
    text-align: right;
    display: flex;
    align-items: center;
    gap: 12px;
}

.history-download-btn {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border-light);
    background: var(--bg-primary);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.history-download-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(67, 97, 238, 0.08);
}

.history-item-msgs {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.history-item-comment {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    font-size: 11px;
    font-weight: 600;
}

/* ===== Sidebar brand with company name ===== */

.sidebar-brand {
    display: flex;
    flex-direction: column;
}

/* When sidebar collapsed */
.sidebar.collapsed .sidebar-brand {
    display: none;
}

/* Remove old company badge from sidebar-company */
.sidebar-company {
    display: none;
}

/* ===== History Stats Bar ===== */
.history-stats-bar {
    display: flex;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.history-stat {
    flex: 1;
    text-align: center;
    padding: 12px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.history-stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    display: block;
}

.history-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Page title with icon */
.page-title i {
    font-size: 24px;
    color: var(--accent-primary);
}

/* ===== SVG Icons in sidebar ===== */
.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

.sidebar.collapsed .nav-icon {
    margin: 0;
}

/* Remove old i styles */
.nav-item i {
    display: none;
}

.btn-icon svg {
    width: 16px;
    height: 16px;
}

/* ===== Topbar (user info in top-right) ===== */
.app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    height: 64px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-company {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.topbar-bell {
    position: relative;
}

.topbar-bell-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 10px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-card);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.topbar-user:hover {
    background: rgba(67, 97, 238, 0.08);
}

.topbar-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--accent-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.topbar-user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

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

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