/* =============================================
   Cowave Global Training Portal — Main Styles
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

:root {
  --primary:   #1a56db;
  --primary-dark: #1241a6;
  --primary-light: #ebf0fd;
  --success:   #10b981;
  --warning:   #f59e0b;
  --danger:    #ef4444;
  --gray-50:   #f9fafb;
  --gray-100:  #f3f4f6;
  --gray-200:  #e5e7eb;
  --gray-400:  #9ca3af;
  --gray-600:  #4b5563;
  --gray-800:  #1f2937;
  --white:     #ffffff;
  --font:      'Inter', -apple-system, sans-serif;
  --radius:    8px;
  --shadow:    0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
}

html, body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-800);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ---- Navbar ---- */
.navbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow);
}
.navbar-brand { display: flex; align-items: center; gap: 12px; }
.nav-logo { height: 40px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-size: 16px; font-weight: 700; color: var(--primary); }
.brand-tagline { font-size: 11px; color: var(--gray-400); letter-spacing: .4px; }
.navbar-user { display: flex; align-items: center; gap: 12px; }
.user-info { text-align: right; }
.user-name { display: block; font-weight: 600; font-size: 13px; }
.user-category { font-size: 11px; color: var(--gray-400); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 16px; border: none; border-radius: var(--radius);
  font-family: var(--font); font-size: 14px; font-weight: 500;
  cursor: pointer; text-decoration: none; transition: all .15s;
  white-space: nowrap;
}
.btn:hover { opacity: .92; }
.btn-primary   { background: var(--primary);  color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger    { background: var(--danger);   color: var(--white); }
.btn-warning   { background: var(--warning);  color: var(--white); }
.btn-outline   { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline-white { background: transparent; color: var(--white); border: 1px solid rgba(255,255,255,.5); }
.btn-outline-white:hover { background: rgba(255,255,255,.1); }
.btn-sm   { padding: 5px 12px; font-size: 12px; }
.btn-block { width: 100%; }

/* ---- Forms ---- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 13px; color: var(--gray-600); }
.form-control {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--gray-200); border-radius: var(--radius);
  font-family: var(--font); font-size: 14px; background: var(--white);
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,86,219,.1); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-full { grid-column: 1 / -1; }

/* ---- Cards ---- */
.card {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--gray-200); box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px; border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--white);
}
.card-header h3 { font-size: 15px; font-weight: 600; }
.card-body { padding: 20px; }
.card-primary { border-left: 4px solid var(--primary); }
.p-0 { padding: 0 !important; }
.p-20 { padding: 20px; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }

/* ---- Alerts ---- */
.alert {
  padding: 12px 16px; border-radius: var(--radius);
  margin-bottom: 16px; font-size: 13px; font-weight: 500;
}
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger  { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

/* ---- Badges ---- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; letter-spacing: .3px;
}
.badge-sm { padding: 2px 8px; font-size: 10px; }
.badge-blue  { background: var(--primary-light); color: var(--primary); }
.badge-green { background: #d1fae5; color: #065f46; }
.badge-red   { background: #fee2e2; color: #991b1b; }
.badge-orange { background: #fef3c7; color: #92400e; }
.badge-gray  { background: var(--gray-100); color: var(--gray-600); }

/* ---- Tables ---- */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--gray-100); font-size: 13px; }
.table th { font-weight: 600; color: var(--gray-600); background: var(--gray-50); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.table tbody tr:hover { background: var(--gray-50); }
.table .actions { white-space: nowrap; }
.table .actions .btn { margin-right: 4px; }
.row-disabled td { opacity: .5; }

/* ---- Login Page ---- */
.login-page {
  background: linear-gradient(135deg, #1241a6 0%, #1a56db 50%, #2563eb 100%);
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.login-container { width: 100%; max-width: 420px; }
.login-card {
  background: var(--white); border-radius: 16px;
  padding: 40px; box-shadow: 0 25px 50px rgba(0,0,0,.3);
}
.login-header { text-align: center; margin-bottom: 32px; }
.login-logo { height: 80px; object-fit: contain; margin-bottom: 12px; }
.login-header h1 { font-size: 22px; font-weight: 700; color: var(--primary); }
.login-header p { color: var(--gray-400); font-size: 13px; }
.login-footer { text-align: center; margin-top: 20px; color: var(--gray-400); font-size: 12px; }
.password-wrapper { position: relative; }
.password-wrapper .form-control { padding-right: 44px; }
.toggle-password {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--gray-400);
}

/* ---- Dashboard ---- */
.dashboard-container { max-width: 1100px; margin: 0 auto; padding: 24px; }
.welcome-banner {
  background: linear-gradient(135deg, var(--primary) 0%, #2563eb 100%);
  color: var(--white); border-radius: 12px; padding: 28px 32px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; box-shadow: var(--shadow-md);
}
.welcome-banner h2 { font-size: 22px; margin-bottom: 8px; }
.welcome-banner .category-badge { margin: 0; }
.welcome-banner .badge-blue { background: rgba(255,255,255,.2); color: var(--white); }
.welcome-stats .stat-box { text-align: center; }
.welcome-stats .stat-number { display: block; font-size: 36px; font-weight: 700; }
.welcome-stats .stat-label  { font-size: 12px; opacity: .8; }

.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 768px) { .dashboard-grid { grid-template-columns: 1fr; } }

/* Session Card */
.session-card { }
.session-title { font-size: 18px; font-weight: 600; margin-bottom: 12px; }
.session-meta { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }
.session-meta span { font-size: 13px; color: var(--gray-600); }

/* Live Indicator */
.live-indicator {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fee2e2; color: #991b1b; padding: 6px 14px;
  border-radius: 20px; font-weight: 600; font-size: 13px;
  margin-bottom: 16px;
}
.live-dot {
  width: 10px; height: 10px; background: var(--danger); border-radius: 50%;
  animation: blink 1s infinite;
}
@keyframes blink { 0%,100% { opacity:1; } 50% { opacity:0; } }

/* Countdown */
.countdown-section { margin: 12px 0; }
.countdown-label { color: var(--gray-600); font-size: 13px; margin-bottom: 10px; }
.countdown-timer {
  display: flex; align-items: center; gap: 8px;
  background: var(--gray-50); border-radius: var(--radius); padding: 16px;
  margin-bottom: 12px;
}
.time-unit { text-align: center; flex: 1; }
.time-unit span { display: block; font-size: 32px; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.time-unit label { font-size: 10px; text-transform: uppercase; color: var(--gray-400); letter-spacing: .5px; }
.time-sep { font-size: 24px; font-weight: 300; color: var(--gray-400); }
.session-schedule-msg { font-size: 13px; color: var(--gray-600); line-height: 1.5; }

.no-session { text-align: center; padding: 24px 0; }
.no-session-icon { font-size: 48px; margin-bottom: 12px; }
.no-session p { color: var(--gray-600); }
.text-muted { color: var(--gray-400) !important; font-size: 12px; }
.text-center { text-align: center; }

.category-info { display: flex; align-items: flex-start; gap: 16px; }
.category-icon { font-size: 32px; }
.category-info h4 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }

.mobile-notice { margin-bottom: 20px; }

/* ---- Admin Layout ---- */
.admin-layout { display: flex; min-height: calc(100vh - 65px); }
.admin-nav {
  width: 220px; background: var(--gray-800); flex-shrink: 0;
  padding: 0; display: flex; flex-direction: column;
}
.admin-nav-header {
  padding: 16px 20px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .8px; color: var(--gray-400);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.admin-nav .nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px; color: var(--gray-400);
  text-decoration: none; transition: all .15s;
  font-size: 13px; font-weight: 500;
}
.admin-nav .nav-item:hover, .admin-nav .nav-item.active {
  background: rgba(255,255,255,.06); color: var(--white);
}
.nav-icon { font-size: 16px; }
.admin-main { flex: 1; padding: 24px; overflow-y: auto; }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.admin-header h2 { font-size: 20px; font-weight: 700; }
.admin-header p { color: var(--gray-400); font-size: 13px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
@media (max-width: 900px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card {
  background: var(--white); border-radius: var(--radius);
  padding: 20px; display: flex; align-items: center; gap: 16px;
  border: 1px solid var(--gray-200); box-shadow: var(--shadow);
}
.stat-icon { font-size: 28px; }
.stat-info { display: flex; flex-direction: column; }
.stat-info .stat-number { font-size: 28px; font-weight: 700; color: var(--primary); }
.stat-info .stat-label  { font-size: 12px; color: var(--gray-400); }

.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .admin-grid { grid-template-columns: 1fr; } }

.activity-list { max-height: 340px; overflow-y: auto; }
.activity-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; border-bottom: 1px solid var(--gray-100);
}
.activity-icon { font-size: 18px; flex-shrink: 0; }
.activity-info { flex: 1; }
.activity-user { font-weight: 600; font-size: 13px; display: block; }
.activity-desc { color: var(--gray-400); font-size: 12px; }
.activity-time { font-size: 11px; color: var(--gray-400); white-space: nowrap; }

/* ---- Modals ---- */
.modal { display: none; position: fixed; inset: 0; z-index: 1000; }
.modal.open { display: flex; align-items: center; justify-content: center; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.modal-content {
  background: var(--white); border-radius: 12px; padding: 24px;
  width: 90%; max-width: 480px; position: relative; z-index: 1;
  max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg);
}
.modal-lg { max-width: 700px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--gray-200);
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close {
  background: none; border: none; font-size: 24px; cursor: pointer;
  color: var(--gray-400); line-height: 1;
}

/* Filter form */
.filter-form { display: flex; gap: 16px; align-items: flex-end; }
.filter-form .form-group { margin-bottom: 0; flex: 1; }

/* Upload progress */
.upload-progress { margin-top: 8px; background: var(--gray-100); border-radius: 4px; height: 6px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--primary); width: 0; transition: width .3s; }

/* Footer */
.footer {
  background: var(--white); border-top: 1px solid var(--gray-200);
  padding: 20px; text-align: center; margin-top: 40px;
}
.footer-content { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 4px; }
.footer p { font-size: 12px; color: var(--gray-400); }
.footer-tagline { color: var(--primary) !important; font-style: italic; }

/* Responsive */
@media (max-width: 768px) {
  .admin-layout { flex-direction: column; }
  .admin-nav { width: 100%; flex-direction: row; flex-wrap: wrap; }
  .navbar-user .user-info { display: none; }
  .filter-form { flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
}
