/* ==========================================================================
   SISTEM PANGGILAN NAMA KONVOKESYEN - STYLESHEET
   Tema: Royal Academic Navy & Gold
   ========================================================================== */

:root {
  --primary-navy: #0a111e;
  --secondary-navy: #0f1d35;
  --card-bg: #14233e;
  --card-border: rgba(212, 175, 55, 0.25);
  --gold-primary: #d4af37;
  --gold-light: #ffd700;
  --gold-dark: #aa8010;
  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-emerald: #10b981;
  --accent-ruby: #ef4444;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-serif: 'Cinzel', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

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

body {
  font-family: var(--font-sans);
  background: var(--primary-navy);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* App Container */
.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.app-header {
  background: linear-gradient(180deg, #070c16 0%, #0c172a 100%);
  border-bottom: 2px solid var(--gold-primary);
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-logo {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold-dark) 100%);
  color: var(--primary-navy);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
}

.header-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  letter-spacing: 1.5px;
  color: var(--gold-light);
  font-weight: 800;
  margin: 0;
}

.header-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Tab Navigation */
.nav-tabs {
  background: #091220;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  padding: 0 32px;
  gap: 8px;
  overflow-x: auto;
}

.tab-link {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 16px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 3px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
}

.tab-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.tab-link.active {
  color: var(--gold-light);
  border-bottom-color: var(--gold-primary);
  background: rgba(212, 175, 55, 0.06);
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 28px 32px;
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-content.active {
  display: block;
}

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

/* Common Card */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.card-header {
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 16px;
}

.card-header h2 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--gold-light);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.5px;
}

.card-header p {
  width: 100%;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 4px;
}

/* Buttons */
.btn {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold-primary) 100%);
  color: #070c16;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #ffe033 0%, #e2be42 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.45);
}

.btn-gold {
  background: #d4af37;
  color: #0a111e;
  font-weight: 700;
}

.btn-gold:hover {
  background: #ffd700;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid rgba(212, 175, 55, 0.4);
}

.btn-outline:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: var(--gold-light);
}

.btn-danger-soft {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn-danger-soft:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.btn-dark {
  background: #080f1a;
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-dark:hover {
  color: #fff;
  background: #0d1726;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
}

/* ==========================================================================
   TAB 1: KAWALAN PENTAS (CONTROL CONSOLE)
   ========================================================================== */
.control-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 24px;
}

@media (max-width: 1024px) {
  .control-grid {
    grid-template-columns: 1fr;
  }
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 20px;
}

.status-indicator.live {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-emerald);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.current-student-display {
  display: flex;
  gap: 20px;
  align-items: center;
  background: rgba(10, 17, 30, 0.6);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
}

.current-avatar-wrap {
  width: 105px;
  height: 125px;
  border-radius: 10px;
  border: 2px solid var(--gold-primary);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.5);
  background: #000;
}

.current-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.current-info {
  flex: 1;
}

.badge-award {
  display: inline-block;
  background: linear-gradient(90deg, #d4af37, #aa8010);
  color: #070c16;
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 12px;
  margin-bottom: 8px;
}

.badge-award:empty {
  display: none;
}

.current-name {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  color: #ffffff;
  margin-bottom: 4px;
  line-height: 1.25;
}

.current-program {
  font-size: 0.95rem;
  color: var(--gold-light);
  font-weight: 600;
}

.current-matric {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.action-buttons-group {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.btn-call-huge {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 16px 20px;
}

.secondary-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.queue-status-bar {
  background: rgba(0, 0, 0, 0.2);
  padding: 14px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.progress-bar-container {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-primary), var(--gold-light));
  transition: width 0.3s ease;
}

/* Pratonton Pentas (Stage Preview) */
.badge-hint {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 3px 8px;
  border-radius: 12px;
  color: var(--text-secondary);
}

.preview-stage-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8);
}

.preview-stage-bg {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 40%, #152238 0%, #0a111e 90%);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
}

.stage-watermark {
  position: absolute;
  top: 16px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-serif);
  font-size: 0.75rem;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.2);
}

.preview-notice {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 12px;
  line-height: 1.4;
}

.preview-notice code {
  color: var(--gold-light);
}

/* ==========================================================================
   LOWER THIRD KOMPONEN (SHARED PREVIEW & BASE)
   ========================================================================== */
.lower-third-container {
  width: 100%;
  position: relative;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 1;
  transform: translateY(0);
}

.lower-third-container.hidden {
  opacity: 0;
  transform: translateY(40px);
}

.lt-content-box {
  background: linear-gradient(135deg, rgba(13, 27, 50, 0.95) 0%, rgba(6, 14, 27, 0.98) 100%);
  border: 1.5px solid var(--gold-primary);
  border-radius: 14px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), 0 0 20px rgba(212, 175, 55, 0.2);
  backdrop-filter: blur(8px);
}

.lt-gold-accent {
  position: absolute;
  top: 0;
  left: 10px;
  right: 10px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
  border-radius: 3px;
}

.lt-photo-frame {
  width: 65px;
  height: 80px;
  border-radius: 8px;
  border: 2px solid var(--gold-primary);
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  background: #000;
}

.lt-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.lt-text-details {
  flex: 1;
  min-width: 0;
}

.lt-award-tag {
  display: inline-block;
  background: linear-gradient(90deg, #d4af37, #aa8010);
  color: #070c16;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 10px;
  margin-bottom: 3px;
}

.lt-award-tag:empty {
  display: none !important;
}

.lt-student-name {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lt-student-program {
  font-size: 0.8rem;
  color: var(--gold-light);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lt-crest {
  color: var(--gold-light);
  font-size: 1.5rem;
  opacity: 0.8;
  padding-right: 8px;
}

/* ==========================================================================
   TAB 2: BORANG PENDAFTARAN GRADUAN
   ========================================================================== */
.form-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 28px;
}

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

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gold-light);
  margin-bottom: 8px;
}

.form-group label i {
  margin-right: 6px;
}

.required {
  color: var(--accent-ruby);
}

.form-control {
  width: 100%;
  background: rgba(10, 17, 30, 0.8);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--gold-light);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
  background: rgba(13, 24, 42, 0.95);
}

.helper-text {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 5px;
}

/* Photo Upload Box */
.photo-upload-box {
  display: flex;
  gap: 16px;
  align-items: center;
  background: rgba(10, 17, 30, 0.5);
  border: 1px dashed rgba(212, 175, 55, 0.4);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.photo-preview-wrapper {
  width: 90px;
  height: 110px;
  border-radius: 8px;
  border: 2px solid var(--gold-primary);
  overflow: hidden;
  background: #000;
  flex-shrink: 0;
}

.photo-preview-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.photo-upload-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Audio Configuration Box */
.audio-selection-box {
  background: rgba(10, 17, 30, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-primary);
}

.radio-label input[type="radio"] {
  accent-color: var(--gold-primary);
  width: 16px;
  height: 16px;
}

.sub-option-box {
  background: rgba(0, 0, 0, 0.25);
  padding: 12px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--gold-primary);
}

.sub-option-box label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 6px;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 20px;
}

/* ==========================================================================
   TAB 3: SENARAI PELAJAR
   ========================================================================== */
.list-toolbar {
  border-bottom: none;
  padding-bottom: 0;
}

.search-filter-box {
  display: flex;
  gap: 12px;
  flex: 1;
  min-width: 280px;
}

.input-with-icon {
  position: relative;
  flex: 1;
}

.input-with-icon i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.input-with-icon input {
  width: 100%;
  background: rgba(10, 17, 30, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 8px 12px 8px 36px;
  color: #fff;
  font-size: 0.88rem;
}

.search-filter-box select {
  background: rgba(10, 17, 30, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.88rem;
}

.list-action-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.table-responsive {
  overflow-x: auto;
  margin-top: 16px;
}

.students-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.students-table th {
  background: rgba(10, 17, 30, 0.9);
  color: var(--gold-light);
  padding: 12px 14px;
  font-weight: 600;
  border-bottom: 2px solid rgba(212, 175, 55, 0.3);
}

.students-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: middle;
}

.students-table tr:hover td {
  background: rgba(212, 175, 55, 0.04);
}

.students-table tr.current-calling td {
  background: rgba(212, 175, 55, 0.12);
  border-left: 3px solid var(--gold-primary);
}

.table-avatar {
  width: 44px;
  height: 52px;
  border-radius: 6px;
  border: 1px solid var(--gold-primary);
  overflow: hidden;
  background: #000;
}

.table-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold-light);
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.action-cell {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon:hover {
  background: var(--gold-primary);
  color: #070c16;
  border-color: var(--gold-primary);
}

/* Highlight Box untuk Pilihan Bahasa Melayu */
.highlight-box {
  background: rgba(212, 175, 55, 0.08);
  border: 1.5px solid rgba(212, 175, 55, 0.4);
  border-radius: var(--radius-sm);
  padding: 18px;
}

.voice-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 6px 12px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 600;
}

.voice-status-badge.warning {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.voice-quick-actions button {
  font-size: 0.82rem;
}

/* ==========================================================================
   TAB 4: TETAPAN SUARA
   ========================================================================== */
.settings-grid {
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 750px;
}

.setting-item label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gold-light);
  margin-bottom: 8px;
}

.range-slider {
  width: 100%;
  accent-color: var(--gold-primary);
  cursor: pointer;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
  accent-color: var(--gold-primary);
  width: 18px;
  height: 18px;
}

/* Footer */
.app-footer {
  background: #060a12;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 12px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 8px;
}

.channel-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-emerald);
  font-weight: 600;
}
