/* Smart Realty Academy — Dark Professional Theme */
:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: #1a2235;
  --bg-card-hover: #1f2a40;
  --bg-input: #0d1320;
  --border: #2a3555;
  --border-light: #374163;
  --text-primary: #f0f4ff;
  --text-secondary: #8b9bc0;
  --text-muted: #5a6a8e;
  --accent: #4f8cff;
  --accent-hover: #6ba0ff;
  --accent-glow: rgba(79, 140, 255, 0.15);
  --success: #34d399;
  --success-bg: rgba(52, 211, 153, 0.1);
  --warning: #fbbf24;
  --warning-bg: rgba(251, 191, 36, 0.1);
  --danger: #f87171;
  --danger-bg: rgba(248, 113, 113, 0.1);
  --gradient: linear-gradient(135deg, #4f8cff 0%, #7c5cfc 100%);
  --gradient-warm: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.4);
  --radius: 12px;
  --radius-lg: 16px;
  --radius-sm: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background: var(--bg-primary); color: var(--text-primary); min-height: 100vh; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Layout */
.app-layout { display: flex; min-height: 100vh; }
.sidebar { width: 260px; background: var(--bg-secondary); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: fixed; height: 100vh; z-index: 100; }
.main-content { margin-left: 260px; flex: 1; padding: 32px; min-height: 100vh; }

/* Sidebar */
.sidebar-logo { padding: 24px 20px; border-bottom: 1px solid var(--border); }
.sidebar-logo h1 { font-size: 18px; font-weight: 800; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; letter-spacing: -0.5px; }
.sidebar-logo span { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.5px; }
.sidebar-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius-sm); color: var(--text-secondary); cursor: pointer; transition: all 0.2s; font-size: 14px; font-weight: 500; }
.nav-item:hover { background: var(--bg-card); color: var(--text-primary); }
.nav-item.active { background: var(--accent-glow); color: var(--accent); }
.nav-item i { width: 20px; text-align: center; font-size: 15px; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid var(--border); }
.user-info { display: flex; align-items: center; gap: 12px; }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--gradient); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.user-details { flex: 1; }
.user-details .name { font-size: 13px; font-weight: 600; }
.user-details .role { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.logout-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 8px; border-radius: 6px; transition: all 0.2s; }
.logout-btn:hover { color: var(--danger); background: var(--danger-bg); }

/* Login Page */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg-primary); padding: 20px; }
.login-container { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 48px; width: 100%; max-width: 420px; box-shadow: var(--shadow-lg); }
.login-header { text-align: center; margin-bottom: 36px; }
.login-header h1 { font-size: 28px; font-weight: 800; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 4px; }
.login-header .subtitle { color: var(--text-muted); font-size: 13px; letter-spacing: 1px; text-transform: uppercase; }
.login-header p { color: var(--text-secondary); margin-top: 16px; font-size: 14px; }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.form-input { width: 100%; padding: 12px 16px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); font-size: 14px; font-family: inherit; transition: all 0.2s; }
.form-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-input::placeholder { color: var(--text-muted); }

/* Buttons */
.btn { padding: 12px 24px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer; transition: all 0.2s; border: none; display: inline-flex; align-items: center; gap: 8px; }
.btn-primary { background: var(--gradient); color: white; }
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(79,140,255,0.3); }
.btn-secondary { background: var(--bg-card); border: 1px solid var(--border); color: var(--text-primary); }
.btn-secondary:hover { background: var(--bg-card-hover); border-color: var(--border-light); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(248,113,113,0.2); }
.btn-danger:hover { background: rgba(248,113,113,0.2); }
.btn-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(52,211,153,0.2); }
.btn-success:hover { background: rgba(52,211,153,0.2); }
.btn-full { width: 100%; justify-content: center; }
.btn-lg { padding: 16px 32px; font-size: 16px; border-radius: var(--radius); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* Page header */
.page-header { margin-bottom: 32px; }
.page-header h2 { font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.page-header p { color: var(--text-secondary); font-size: 15px; }

/* Cards */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; transition: all 0.2s; }
.card:hover { border-color: var(--border-light); }
.card-grid { display: grid; gap: 24px; }
.card-grid-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.card-grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card-grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* Module cards */
.module-card { position: relative; overflow: hidden; cursor: pointer; }
.module-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.module-icon { width: 56px; height: 56px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 24px; margin-bottom: 16px; }
.module-icon.captacion { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.module-icon.cierre { background: linear-gradient(135deg, #34d399, #4f8cff); }
.module-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.module-card p { color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin-bottom: 16px; }
.module-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.module-badge.new { background: var(--accent-glow); color: var(--accent); }

/* Module detail sections */
.section-list { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.section-item { display: flex; align-items: center; gap: 16px; padding: 16px 20px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; transition: all 0.2s; }
.section-item:hover { background: var(--bg-card-hover); border-color: var(--border-light); }
.section-item.completed { border-color: var(--success); background: var(--success-bg); }
.section-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.section-icon.video { background: rgba(239,68,68,0.15); color: #ef4444; }
.section-icon.reading { background: rgba(79,140,255,0.15); color: var(--accent); }
.section-icon.simulation { background: rgba(168,85,247,0.15); color: #a855f7; }
.section-icon.evaluation { background: rgba(52,211,153,0.15); color: var(--success); }
.section-info { flex: 1; }
.section-info h4 { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.section-info p { font-size: 13px; color: var(--text-muted); }
.section-status { font-size: 18px; }
.section-status.done { color: var(--success); }
.section-status.pending { color: var(--text-muted); }

/* Chat interface */
.chat-container { display: flex; flex-direction: column; height: calc(100vh - 160px); max-height: 700px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.chat-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; background: var(--bg-card); }
.chat-header-info { display: flex; align-items: center; gap: 12px; }
.chat-avatar { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.chat-avatar.captacion { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.chat-avatar.cierre { background: linear-gradient(135deg, #34d399, #4f8cff); }
.chat-header-info .name { font-weight: 600; font-size: 15px; }
.chat-header-info .status { font-size: 12px; color: var(--success); }
.chat-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.chat-message { max-width: 75%; padding: 12px 16px; border-radius: 16px; font-size: 14px; line-height: 1.6; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.chat-message.user { align-self: flex-end; background: var(--accent); color: white; border-bottom-right-radius: 4px; }
.chat-message.assistant { align-self: flex-start; background: var(--bg-card); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.chat-message.system { align-self: center; background: var(--bg-card); color: var(--text-muted); font-size: 13px; padding: 8px 16px; border-radius: 20px; }
.chat-input-area { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; gap: 12px; background: var(--bg-card); }
.chat-input { flex: 1; padding: 12px 16px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 24px; color: var(--text-primary); font-size: 14px; font-family: inherit; resize: none; }
.chat-input:focus { outline: none; border-color: var(--accent); }
.chat-send { width: 44px; height: 44px; border-radius: 50%; background: var(--gradient); border: none; color: white; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 16px; transition: all 0.2s; flex-shrink: 0; }
.chat-send:hover { transform: scale(1.05); }
.chat-send:disabled { opacity: 0.5; transform: none; }
.typing-indicator { display: flex; gap: 4px; padding: 12px 16px; align-self: flex-start; }
.typing-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); animation: typing 1.4s infinite; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }

/* Evaluation */
.eval-card { text-align: center; padding: 40px; }
.eval-score { font-size: 72px; font-weight: 800; margin: 16px 0; }
.eval-score.high { color: var(--success); }
.eval-score.mid { color: var(--warning); }
.eval-score.low { color: var(--danger); }
.eval-bar { display: flex; gap: 16px; justify-content: center; margin: 24px 0; flex-wrap: wrap; }
.eval-bar-item { text-align: center; }
.eval-bar-item .label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.eval-bar-item .value { font-size: 24px; font-weight: 700; }
.eval-section { text-align: left; margin-top: 24px; padding: 20px; background: var(--bg-secondary); border-radius: var(--radius); }
.eval-section h4 { font-size: 14px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.eval-section ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.eval-section li { font-size: 14px; color: var(--text-secondary); padding-left: 20px; position: relative; line-height: 1.5; }
.eval-section li::before { content: ''; position: absolute; left: 0; top: 8px; width: 6px; height: 6px; border-radius: 50%; }
.eval-section.strengths li::before { background: var(--success); }
.eval-section.weaknesses li::before { background: var(--danger); }
.eval-section.recommendations li::before { background: var(--accent); }

/* Stats cards */
.stat-card { padding: 20px; }
.stat-card .stat-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; margin-bottom: 12px; }
.stat-card .stat-value { font-size: 32px; font-weight: 800; margin-bottom: 4px; }
.stat-card .stat-label { font-size: 13px; color: var(--text-muted); }

/* Table */
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; font-size: 14px; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
td { color: var(--text-secondary); }
tr:hover td { background: var(--bg-card-hover); }
.badge { display: inline-flex; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--accent-glow); color: var(--accent); }

/* Video placeholder */
.video-placeholder { width: 100%; aspect-ratio: 16/9; background: var(--bg-secondary); border: 2px dashed var(--border); border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-muted); gap: 12px; margin-bottom: 24px; }
.video-placeholder i { font-size: 48px; }

/* Reading content */
.reading-content { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; line-height: 1.8; color: var(--text-secondary); }
.reading-content h3 { color: var(--text-primary); font-size: 20px; margin: 24px 0 12px; }
.reading-content h3:first-child { margin-top: 0; }
.reading-content p { margin-bottom: 16px; }
.reading-content ul { padding-left: 24px; margin-bottom: 16px; }
.reading-content li { margin-bottom: 8px; }
.reading-content strong { color: var(--text-primary); }
.reading-content .tip { background: var(--accent-glow); border-left: 3px solid var(--accent); padding: 16px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 16px 0; }

/* Back button */
.back-btn { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); cursor: pointer; font-size: 14px; margin-bottom: 24px; padding: 8px 0; transition: color 0.2s; background: none; border: none; font-family: inherit; }
.back-btn:hover { color: var(--text-primary); }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 20px; }
  .mobile-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
  .hamburger { display: block; background: none; border: none; color: var(--text-primary); font-size: 20px; cursor: pointer; }
  .chat-message { max-width: 85%; }
}
@media (min-width: 769px) {
  .mobile-header { display: none; }
  .hamburger { display: none; }
}

/* Animations */
.fade-in { animation: fadeIn 0.3s ease; }
.slide-up { animation: slideUp 0.4s ease; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* History list */
.history-list { display: flex; flex-direction: column; gap: 12px; }
.history-item { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); transition: all 0.2s; cursor: pointer; }
.history-item:hover { background: var(--bg-card-hover); }
.history-item .info { display: flex; align-items: center; gap: 12px; }
.history-item .score-badge { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state i { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 18px; color: var(--text-secondary); margin-bottom: 8px; }

/* Loading spinner */
.spinner { width: 24px; height: 24px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Nav section label */
.nav-section { padding: 8px 16px; font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.5px; margin-top: 16px; }
