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

/* ============================================ */
/* CSS Variables                                */
/* ============================================ */

:root {
  --bg:           #080c14;
  --bg-2:         #0d1220;
  --bg-3:         #111827;
  --surface:      #161d2e;
  --surface-2:    #1c2540;
  --border:       rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.14);

  --accent:       #3b82f6;
  --accent-glow:  rgba(59,130,246,0.35);
  --accent-2:     #6366f1;
  --success:      #10b981;
  --danger:       #ef4444;
  --warn:         #f59e0b;

  --text:         #f1f5f9;
  --text-2:       #94a3b8;
  --text-3:       #475569;

  --radius:       14px;
  --radius-sm:    8px;
  --radius-lg:    20px;

  --shadow:       0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg:    0 12px 48px rgba(0,0,0,0.6);

  --font:         'Outfit', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --transition:   all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================ */
/* Reset & Base                                 */
/* ============================================ */

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

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding: 24px;
  -webkit-font-smoothing: antialiased;
}

/* Subtle grid background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(59,130,246,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,130,246,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  z-index: -1;
  pointer-events: none;
}

/* ============================================ */
/* Typography                                   */
/* ============================================ */

h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  text-align: center;
  margin: 2rem 0 1.5rem;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #60a5fa, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.2rem;
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}

h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 1px;
}

p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-2);
  margin-bottom: 1rem;
}

/* ============================================ */
/* Layout                                       */
/* ============================================ */

main {
  max-width: 860px;
  margin: 0 auto;
  padding: 2.5rem;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

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

/* ============================================ */
/* Buttons                                      */
/* ============================================ */

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.75rem 1.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.2px;
  min-height: 44px;
  white-space: nowrap;
}

button::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background 0.2s;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--accent-glow);
}

button:hover::after {
  background: rgba(255,255,255,0.07);
}

button:active {
  transform: translateY(0);
}

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Secondary */
button.secondary {
  background: var(--surface-2);
  color: var(--text-2);
  border-color: var(--border);
}

button.secondary:hover {
  border-color: var(--border-hover);
  color: var(--text);
  box-shadow: none;
}

/* Danger */
button.danger {
  background: rgba(239,68,68,0.12);
  color: var(--danger);
  border-color: rgba(239,68,68,0.25);
}

button.danger:hover {
  background: rgba(239,68,68,0.2);
  box-shadow: 0 4px 16px rgba(239,68,68,0.2);
}

/* Loading state */
button.loading {
  pointer-events: none;
  opacity: 0.7;
}

button.loading::before {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* ============================================ */
/* Inputs                                       */
/* ============================================ */

input[type="number"],
input[type="text"],
input[type="email"],
input[type="password"],
input[type="datetime-local"],
textarea,
select {
  padding: 0.8rem 1.1rem;
  font-size: 0.95rem;
  font-family: var(--font);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  color: var(--text);
  transition: var(--transition);
  width: 100%;
  margin-bottom: 1rem;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-3);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

input.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239,68,68,0.12);
}

input.success {
  border-color: var(--success);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.12);
}

textarea {
  min-height: 100px;
  resize: vertical;
}

label {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 500;
  color: var(--text-2);
  font-size: 0.9rem;
}

input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
  margin: 0;
}

/* ============================================ */
/* Cards                                        */
/* ============================================ */

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

/* ============================================ */
/* Header Actions                               */
/* ============================================ */

.header-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1rem;
}

/* ============================================ */
/* User Info Bar                                */
/* ============================================ */

.user-info {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.8rem 1.2rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.user-info span {
  color: var(--text);
  font-weight: 500;
}

/* ============================================ */
/* Filters Section                              */
/* ============================================ */

.filters-section {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.filter-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.filter-tab {
  background: var(--bg-2);
  color: var(--text-2);
  border: 1px solid var(--border);
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.88rem;
  font-weight: 500;
  min-height: auto;
}

.filter-tab:hover {
  color: var(--text);
  border-color: var(--border-hover);
  transform: none;
  box-shadow: none;
}

.filter-tab.active {
  background: rgba(59,130,246,0.15);
  color: #60a5fa;
  border-color: rgba(59,130,246,0.35);
  box-shadow: none;
}

.search-box input {
  margin-bottom: 0;
}

/* ============================================ */
/* Conferences Grid                             */
/* ============================================ */

.conferences-container {
  min-height: 300px;
}

.conferences-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

/* ============================================ */
/* Conference Card                              */
/* ============================================ */

.conference-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.conference-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  opacity: 0;
  transition: opacity 0.2s;
}

.conference-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.conference-card:hover::before {
  opacity: 1;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.card-header h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  word-break: break-word;
  line-height: 1.4;
}

/* Status badges */
.status-badge {
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: var(--font-mono);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.status-badge.active,
.status-badge.ongoing {
  background: rgba(16,185,129,0.12);
  color: #34d399;
  border: 1px solid rgba(16,185,129,0.25);
}

.status-badge.scheduled {
  background: rgba(59,130,246,0.12);
  color: #60a5fa;
  border: 1px solid rgba(59,130,246,0.25);
}

.status-badge.ended {
  background: rgba(71,85,105,0.3);
  color: var(--text-3);
  border: 1px solid rgba(71,85,105,0.3);
}

.card-description {
  color: var(--text-2);
  font-size: 0.88rem;
  line-height: 1.55;
  margin: 0;
}

.card-info {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.info-label {
  color: var(--text-3);
  font-weight: 500;
}

.info-item span:last-child {
  color: var(--text-2);
  font-weight: 500;
}

.conf-id-value {
  font-family: monospace;
  color: var(--accent) !important;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
}

.card-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

.host-badge {
  background: rgba(245,158,11,0.12);
  color: #fbbf24;
  border: 1px solid rgba(245,158,11,0.25);
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  flex: 1;
  text-align: center;
}

.card-actions button {
  flex: 1;
  min-width: 80px;
  padding: 0.55rem 0.9rem;
  font-size: 0.85rem;
  min-height: 36px;
}

/* ============================================ */
/* Loading & Empty States                       */
/* ============================================ */

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(59,130,246,0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-state p {
  margin-top: 1.2rem;
  color: var(--text-2);
  font-size: 0.95rem;
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-icon {
  font-size: 3.5rem;
  margin-bottom: 1.2rem;
  opacity: 0.5;
}

.empty-state h3 {
  color: var(--text);
  font-size: 1.3rem;
  margin-bottom: 0.6rem;
}

.empty-state p {
  color: var(--text-2);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

/* ============================================ */
/* Pagination                                   */
/* ============================================ */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin: 2rem 0;
}

.pagination button {
  padding: 0.5rem 1.2rem;
  min-height: 38px;
  font-size: 0.88rem;
}

.pagination button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

#pageInfo {
  color: var(--text-2);
  font-size: 0.88rem;
  font-family: var(--font-mono);
}

/* ============================================ */
/* Form Extensions                              */
/* ============================================ */

.form-group {
  margin-bottom: 1.25rem;
}

.conference-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

.conference-form h3 {
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.conference-label {
  color: var(--text-2);
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
}

.settings-section {
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 1.25rem;
  border-radius: var(--radius-sm);
  margin: 1.25rem 0;
}

.settings-section h4 {
  font-size: 0.78rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
}

.checkbox-group {
  margin: 0.75rem 0;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  color: var(--text-2);
  font-weight: 400;
  font-size: 0.92rem;
  margin-bottom: 0;
  transition: color 0.2s;
}

.checkbox-group label:hover {
  color: var(--text);
}

.input-hint {
  display: block;
  margin-top: 0.3rem;
  color: var(--text-3);
  font-size: 0.8rem;
}

.button-container {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

/* ============================================ */
/* Conference Preview                           */
/* ============================================ */

.conference-preview {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin: 1.25rem 0;
}

.conference-preview h4 {
  font-size: 0.78rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.9rem;
}

.preview-content {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.preview-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-2);
  font-size: 0.88rem;
}

.preview-label {
  color: var(--text-3);
  font-weight: 500;
}

/* ============================================ */
/* Messages / Alerts                            */
/* ============================================ */

.error-message {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  color: #fca5a5;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-sm);
  margin: 1rem 0;
  font-size: 0.9rem;
}

.success-message,
.info-message {
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.2);
  color: #6ee7b7;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-sm);
  margin: 1rem 0;
  font-size: 0.9rem;
}

.alert {
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-sm);
  margin: 1rem 0;
  font-size: 0.9rem;
  border-left: 3px solid;
}

.alert-success {
  background: rgba(16,185,129,0.08);
  border-left-color: var(--success);
  color: #6ee7b7;
}

.alert-error {
  background: rgba(239,68,68,0.08);
  border-left-color: var(--danger);
  color: #fca5a5;
}

.alert-info {
  background: rgba(59,130,246,0.08);
  border-left-color: var(--accent);
  color: #93c5fd;
}

/* ============================================ */
/* Recent Conferences                           */
/* ============================================ */

.recent-conferences {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 2rem;
}

.recent-conferences h3 {
  font-size: 0.78rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.recent-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.recent-item:hover {
  border-color: var(--border-hover);
  transform: translateX(3px);
}

.recent-info strong {
  display: block;
  color: var(--text);
  font-size: 0.92rem;
  margin-bottom: 0.15rem;
}

.recent-info small {
  color: var(--text-3);
  font-size: 0.8rem;
}

.quick-join-btn {
  background: rgba(59,130,246,0.12);
  color: #60a5fa;
  border: 1px solid rgba(59,130,246,0.25);
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  min-height: auto;
}

.quick-join-btn:hover {
  background: rgba(59,130,246,0.2);
  transform: none;
  box-shadow: none;
}

.loading-text,
.empty-text {
  color: var(--text-3);
  font-size: 0.88rem;
  text-align: center;
  padding: 1rem;
  font-style: italic;
}

/* ============================================ */
/* Scrollbar                                    */
/* ============================================ */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--surface-2);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* ============================================ */
/* Links                                        */
/* ============================================ */

a {
  color: #60a5fa;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

a:hover { color: #93c5fd; }

/* ============================================ */
/* Utility Classes                              */
/* ============================================ */

.text-center { text-align: center; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }

/* ============================================ */
/* Grid                                         */
/* ============================================ */

.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

/* ============================================ */
/* Animations                                   */
/* ============================================ */

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

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

.fade-in {
  animation: fadeIn 0.3s ease-out forwards;
}

/* ============================================ */
/* Responsive                                   */
/* ============================================ */

@media (max-width: 768px) {
  body { padding: 12px; }

  h1 { font-size: 1.9rem; }

  main {
    padding: 1.25rem;
    border-radius: var(--radius);
  }

  .conferences-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .header-actions,
  .card-actions,
  .button-container {
    flex-direction: column;
  }

  .header-actions button,
  .card-actions button,
  .button-container button {
    width: 100%;
  }

  .filter-tabs { flex-direction: column; }
  .filter-tab { width: 100%; text-align: center; }
  .pagination { gap: 0.75rem; }

  .grid-2,
  .grid-3 { grid-template-columns: 1fr; }
}

.video-container.screen-sharing {
    outline: 2px solid var(--accent, #6c63ff);
    position: relative;
}

.video-container.screen-sharing::after {
    content: '🖥️ Screen';
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--accent, #6c63ff);
    color: #fff;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
}
/* ─── Edit Conference Modal ─────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.4rem 1rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 1.1rem;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-3);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  line-height: 1;
}

.modal-close:hover { background: var(--border); color: var(--text-1); }

.modal-form {
  padding: 1.2rem 1.4rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-2);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group input[type="datetime-local"],
.form-group textarea {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text-1);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color .15s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group textarea { resize: vertical; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group--checkbox {
  justify-content: flex-end;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.87rem;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent);
}

.field-hint {
  font-weight: 400;
  color: var(--text-3);
  font-size: 0.78rem;
}

.required { color: var(--danger, #e53935); }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.7rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

@media (max-width: 500px) {
  .form-row { grid-template-columns: 1fr; }
}
