/* MedConf Manager - Main Stylesheet */

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

:root {
  --primary: #191919;
  --primary-light: #A78BFA;
  --primary-dark: #111113;
  --accent: #A78BFA;
  --accent-hover: #9575E6;
  --accent-glow: rgba(167, 139, 250, 0.15);
  --accent-subtle: rgba(167, 139, 250, 0.09);
  --success: #30A46C;
  --success-glow: rgba(48, 164, 108, 0.15);
  --warning: #F5A623;
  --danger: #E5484D;
  --info: #52A9FF;
  --bg: #111113;
  --bg-card: #191919;
  --bg-card-solid: #191919;
  --bg-input: #1a1a1c;
  --bg-elevated: #222225;
  --text: #EDEDEF;
  --text-muted: #8B8D98;
  --text-faint: #4E4F58;
  --border: #2E2E32;
  --border-subtle: #232326;
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.55);
  --shadow-glow: none;
  --transition: all 0.15s ease;
  --transition-fast: all 0.1s ease;
  --glass: none;
}

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

html, body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: none;
  pointer-events: none;
  z-index: 0;
}

/* ===== LAYOUT ===== */
.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  z-index: 1;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--bg-card);
  border-radius: var(--radius);
  margin-bottom: 24px;
  border: 1px solid var(--border);
}

.app-header h1 {
  font-size: 1.4rem;
  font-weight: 800;
  color: #f5f5f7;
  letter-spacing: -0.02em;
}

.app-header .nav-links {
  display: flex;
  gap: 12px;
}

.app-header .nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 8px;
  transition: var(--transition);
  font-size: 0.9rem;
}

.app-header .nav-links a:hover,
.app-header .nav-links a.active {
  background: var(--bg-elevated);
  color: var(--text);
}

/* ===== AUTH BADGE ===== */
#auth-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
}
.auth-user-label {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  white-space: nowrap;
}
.auth-logout-btn {
  background: rgba(255, 69, 58, 0.1);
  border: 1px solid rgba(255, 69, 58, 0.2);
  color: #FF453A;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.auth-logout-btn:hover {
  background: rgba(255, 69, 58, 0.2);
  border-color: rgba(255, 69, 58, 0.4);
}
.dropdown-item:hover {
  background: rgba(139, 92, 246, 0.08) !important;
}
.auth-setup-link {
  color: var(--text-faint) !important;
  font-size: 0.78rem !important;
  text-decoration: none;
  padding: 5px 10px !important;
  background: var(--bg-elevated) !important;
  border: 1px dashed var(--border);
  border-radius: 6px !important;
  transition: all 0.15s;
}
.auth-setup-link:hover {
  color: var(--text) !important;
  border-color: var(--text-muted) !important;
}

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card::before {
  display: none;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.card-header h2 {
  font-size: 1.2rem;
  font-weight: 600;
}

.card-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

/* ===== GRID ===== */
.grid {
  display: grid;
  gap: 20px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: var(--transition);
  text-decoration: none;
  color: white;
  letter-spacing: -0.01em;
  position: relative;
  overflow: hidden;
}

.btn::after {
  display: none;
}

.btn-primary { background: var(--accent); color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.35); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-accent { background: var(--accent); color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.35); }
.btn-accent:hover { background: var(--accent-hover); }
.btn-success { background: var(--success); }
.btn-success:hover { background: #29955F; }
.btn-warning { background: var(--warning); color: #111; }
.btn-warning:hover { background: #E09400; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #D13438; }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline::after { display: none; }
.btn-outline:hover { background: var(--bg-elevated); border-color: var(--text-faint); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; border-radius: 6px; }
.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: 8px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; filter: grayscale(0.3); }
.btn:active:not(:disabled) { opacity: 0.85; }

/* ===== FORMS ===== */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  background: var(--bg-input);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238892a4' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

/* ===== FILE UPLOAD ===== */
.file-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-input);
  position: relative;
}

.file-upload-zone:hover,
.file-upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-subtle);
}

.file-upload-zone .upload-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

.file-upload-zone p {
  color: var(--text-muted);
  margin-bottom: 8px;
}

.file-list {
  margin-top: 16px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-input);
  border-radius: 8px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
}

.file-item .file-name {
  font-size: 0.9rem;
  flex: 1;
}

.file-item .file-size {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 0 12px;
}

.file-item .file-main-badge {
  background: var(--success);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  margin-right: 8px;
}

/* ===== TABLE ===== */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

table th, table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

table th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
}

table tr:hover td {
  background: rgba(255,255,255,0.02);
}

/* ===== STATUS BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-pending { background: rgba(245, 158, 11, 0.12); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.2); }
.badge-uploaded { background: rgba(16, 185, 129, 0.12); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-presenting { background: rgba(139, 92, 246, 0.12); color: var(--accent); border: 1px solid rgba(139, 92, 246, 0.2); }
.badge-done { background: rgba(123, 132, 152, 0.12); color: var(--text-muted); border: 1px solid rgba(123, 132, 152, 0.2); }

/* ===== MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.modal-overlay.active {
  display: flex;
  animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalSlideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideUp {
  from { transform: translateY(12px) scale(0.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal h2 {
  margin-bottom: 20px;
  font-size: 1.3rem;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* ===== TABS ===== */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--bg-input);
  border-radius: 10px;
  padding: 4px;
  border: 1px solid var(--border-subtle);
}

.tab {
  padding: 10px 20px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition);
  color: var(--text-muted);
  border: none;
  background: none;
  font-weight: 500;
}

.tab:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.tab.active {
  background: var(--bg-elevated);
  color: var(--text);
  font-weight: 600;
}

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
}

.toast {
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 20px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastSlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 300px;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }

@keyframes toastSlideIn {
  from { transform: translateX(100%) scale(0.95); opacity: 0; }
  to { transform: translateX(0) scale(1); opacity: 1; }
}

/* ===== PRESENTATION LIST (Room Display / Touch) ===== */
.presentation-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 16px;
}

.presentation-card:hover {
  border-color: var(--text-faint);
  background: var(--bg-elevated);
}

.presentation-card.active {
  border-color: var(--accent);
  background: var(--accent-subtle);
}

.presentation-card .position-number {
  width: 48px;
  height: 48px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  flex-shrink: 0;
}

.presentation-card .presenter-info {
  flex: 1;
}

.presentation-card .presenter-name {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.presentation-card .presentation-title {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.presentation-card .open-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.presentation-card .open-btn:hover {
  background: var(--accent-hover);
  transform: scale(1.05);
}

/* ===== TIMER DISPLAY ===== */
.timer-fullscreen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px;
  background: #000;
}

.timer-display {
  font-size: 18vw;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-family: 'Courier New', monospace;
  letter-spacing: 0.05em;
  transition: color 0.5s ease;
}

.timer-display.green { color: #27ae60; }
.timer-display.yellow { color: #f39c12; }
.timer-display.red { color: #e74c3c; animation: pulse 1s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.timer-message-display {
  font-size: 4vw;
  color: #fff;
  text-align: center;
  padding: 20px 40px;
  background: rgba(229, 72, 77, 0.9);
  border-radius: 12px;
  margin-top: 30px;
  max-width: 80%;
  animation: fadeIn 0.5s ease;
}

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

.timer-presenter-name {
  font-size: 3vw;
  color: var(--text-muted);
  margin-bottom: 20px;
  text-align: center;
}

/* ===== DOOR DISPLAY ===== */
.door-fullscreen {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #000;
  padding: 30px;
}

.door-current {
  flex: 0 0 auto;
  padding: 30px 40px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  border-radius: 16px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.door-current .speaker-name {
  font-size: 4vw;
  font-weight: 700;
  margin-bottom: 8px;
}

.door-current .presentation-title {
  font-size: 2vw;
  color: rgba(255,255,255,0.8);
  margin-bottom: 20px;
}

.door-progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
  overflow: hidden;
}

.door-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 1s linear;
}

.door-upcoming {
  flex: 1;
  overflow: hidden;
}

.door-upcoming-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.door-upcoming-item .position {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.door-upcoming-item .info {
  flex: 1;
}

.door-upcoming-item .name {
  font-size: 1.5vw;
  font-weight: 600;
}

.door-upcoming-item .title {
  font-size: 1vw;
  color: var(--text-muted);
}

/* Door Portrait Mode */
.door-fullscreen.portrait .door-current .speaker-name {
  font-size: 6vw;
}
.door-fullscreen.portrait .door-current .presentation-title {
  font-size: 3vw;
}
.door-fullscreen.portrait .door-upcoming-item .name {
  font-size: 3vw;
}
.door-fullscreen.portrait .door-upcoming-item .title {
  font-size: 2vw;
}

/* ===== SPEAKER DESK DISPLAY ===== */
.speakerdesk-fullscreen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--primary-dark);
  padding: 40px;
  text-align: center;
}

.speakerdesk-name {
  font-size: 48px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
}

.speakerdesk-title {
  font-size: 24px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 12px;
}

.speakerdesk-institution {
  font-size: 20px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 8px;
}

.speakerdesk-location {
  font-size: 18px;
  color: rgba(255,255,255,0.4);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(56, 65, 90, 0.5); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== LOADING ===== */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== SESSION ACCORDION ===== */
.session-block {
  margin-bottom: 16px;
}

.session-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
}

.session-header:hover {
  border-color: var(--text-faint);
  background: var(--bg-elevated);
}

.session-header h3 {
  font-size: 1rem;
}

.session-header .session-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.session-content {
  padding: 12px 0 0;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .icon {
  font-size: 4rem;
  margin-bottom: 16px;
  opacity: 0.3;
}

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

.empty-state p {
  max-width: 400px;
  margin: 0 auto;
}

/* ===== UTILITY ===== */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.hidden { display: none !important; }
