/* Design System & Custom Properties */
:root {
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Color Palette (Deep Ocean/Slate Theme) */
  --bg-app: #0f172a;
  --bg-card: #1e293b;
  --bg-input: #334155;
  --border-card: #475569;
  
  --color-text-primary: #f8fafc;
  --color-text-secondary: #94a3b8;
  --color-text-muted: #64748b;
  
  --color-primary: #6366f1; /* Indigo */
  --color-primary-hover: #4f46e5;
  --color-primary-light: rgba(99, 102, 241, 0.15);
  
  --color-success: #10b981; /* Emerald Green */
  --color-success-hover: #059669;
  --color-success-light: rgba(16, 185, 129, 0.1);
  
  --color-warning: #f59e0b; /* Amber */
  --color-warning-light: rgba(245, 158, 11, 0.1);
  
  --color-danger: #ef4444; /* Rose Red */
  --color-danger-hover: #dc2626;
  
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 20px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.2);
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

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

body {
  background-color: var(--bg-app);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Layout Containers */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header Styles */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
  border-bottom: 1px solid var(--border-card);
}

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

.logo-icon {
  width: 48px;
  height: 48px;
  background-color: var(--color-primary);
  color: #fff;
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  box-shadow: var(--shadow-glow);
}

.header-title h1 {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.header-title p {
  color: var(--color-text-secondary);
  font-size: 14px;
  font-weight: 400;
}

/* Badges */
.mode-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: var(--transition-normal);
}

.viewer-mode {
  background-color: rgba(148, 163, 184, 0.1);
  color: var(--color-text-secondary);
}

.editor-mode {
  background-color: var(--color-warning-light);
  color: var(--color-warning);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.1);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: currentColor;
}

.viewer-mode .badge-dot {
  animation: none;
}

.editor-mode .badge-dot {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.6; }
}

/* Control & Actions Bar */
.control-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border-card);
}

/* Tabs */
.tabs-container {
  display: flex;
  background-color: rgba(15, 23, 42, 0.6);
  padding: 4px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-card);
}

.tab-btn {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 15px;
  padding: 8px 18px;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-fast);
}

.tab-btn:hover {
  color: var(--color-text-primary);
}

.tab-btn.active {
  background-color: var(--bg-card);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

/* Actions Form styling */
.actions-container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-group label {
  color: var(--color-text-secondary);
  font-size: 14px;
  font-weight: 500;
}

.select-wrapper {
  position: relative;
}

.select-wrapper select,
.select-container select {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--color-text-primary);
  padding: 8px 36px 8px 12px;
  border-radius: var(--border-radius-sm);
  font-size: 14px;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  min-width: 160px;
  transition: var(--transition-fast);
}

.select-wrapper select:focus,
.select-container select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-light);
}

.select-wrapper::after,
.select-container::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-20%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--color-text-secondary);
  pointer-events: none;
}

/* Button UI */
.button-group {
  display: flex;
  gap: 10px;
}

.btn {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  transition: var(--transition-fast);
}

.btn-icon {
  font-size: 14px;
}

.btn-primary {
  background-color: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
}

.btn-secondary {
  background-color: var(--bg-card);
  border-color: var(--border-card);
  color: var(--color-text-primary);
}

.btn-secondary:hover {
  background-color: var(--bg-input);
  border-color: var(--color-text-secondary);
}

.btn-success {
  background-color: var(--color-success);
  color: #fff;
}

.btn-success:hover {
  background-color: var(--color-success-hover);
}

.btn-danger {
  background-color: transparent;
  border-color: var(--color-danger);
  color: var(--color-danger);
}

.btn-danger:hover {
  background-color: var(--color-danger);
  color: #fff;
}

/* Main Content Styles */
.main-content {
  flex: 1;
  padding: 30px 0;
}

.schedule-view {
  min-height: 400px;
}

/* Table Card Layout for Morning Report */
.morning-report-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
  margin-top: -10px;
}

.morning-report-table th {
  text-align: left;
  padding: 12px 18px;
  color: var(--color-text-secondary);
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.mr-row {
  background-color: var(--bg-card);
  border-radius: var(--border-radius-md);
  transition: var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.mr-row:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.mr-row td {
  padding: 16px 18px;
  font-size: 15px;
  border-top: 1px solid transparent;
  border-bottom: 1px solid transparent;
}

.mr-row td:first-child {
  border-left: 1px solid transparent;
  border-top-left-radius: var(--border-radius-md);
  border-bottom-left-radius: var(--border-radius-md);
  font-weight: 600;
}

.mr-row td:last-child {
  border-right: 1px solid transparent;
  border-top-right-radius: var(--border-radius-md);
  border-bottom-right-radius: var(--border-radius-md);
}

.day-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.day-monday { background-color: rgba(99, 102, 241, 0.15); color: #818cf8; }
.day-tuesday { background-color: rgba(16, 185, 129, 0.15); color: #34d399; }
.day-wednesday { background-color: rgba(245, 158, 11, 0.15); color: #fbbf24; }

/* Weekly Lecture Cards (Grid Layout) */
.weekly-lectures-grid {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.week-card {
  background-color: var(--bg-card);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-card);
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.week-card-header {
  border-bottom: 1px solid var(--border-card);
  padding-bottom: 14px;
  margin-bottom: 20px;
}

.week-card-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.week-date-badge {
  background-color: var(--color-primary-light);
  color: #818cf8;
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 9999px;
  font-family: var(--font-body);
  font-weight: 500;
}

.week-didactic-info {
  background-color: rgba(245, 158, 11, 0.05);
  border: 1px dashed rgba(245, 158, 11, 0.3);
  color: var(--color-warning);
  padding: 12px 18px;
  border-radius: var(--border-radius-md);
  font-size: 14px;
  text-align: center;
  font-weight: 500;
}

.hourly-slots-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.slot-block {
  background-color: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-card);
  border-radius: var(--border-radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: var(--transition-fast);
}

.slot-block:hover {
  border-color: var(--color-primary);
}

.slot-time {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 6px;
}

.slot-topic {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
  min-height: 42px;
  word-wrap: break-word;
}

.slot-attending {
  font-size: 13px;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.slot-attending::before {
  content: "👤";
  font-size: 11px;
}

/* Edit Mode Dynamic Form Elements */
.edit-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.edit-field-group label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  letter-spacing: 0.05em;
}

.form-control {
  width: 100%;
  background-color: var(--bg-app);
  border: 1px solid var(--border-card);
  color: var(--color-text-primary);
  padding: 8px 10px;
  border-radius: var(--border-radius-sm);
  font-family: var(--font-body);
  font-size: 13px;
  transition: var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-light);
}

.select-container {
  position: relative;
  width: 100%;
}

.select-container select {
  width: 100%;
  padding-right: 30px !important;
  font-size: 13px;
  background-color: var(--bg-app);
}

.custom-name-input {
  margin-top: 6px;
}

/* Loading & Empty States */
.loading-state,
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  color: var(--color-text-secondary);
  gap: 16px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top-color: var(--color-primary);
  animation: spin 1s linear infinite;
}

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

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
  transition: opacity 0.2s ease;
}

.modal-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--border-radius-lg);
  width: 90%;
  max-width: 400px;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  animation: modalEnter 0.3s ease;
}

@keyframes modalEnter {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
}

.close-btn {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  font-size: 24px;
  cursor: pointer;
}

.close-btn:hover {
  color: var(--color-text-primary);
}

.modal-body {
  margin-bottom: 24px;
}

.modal-body p {
  color: var(--color-text-secondary);
  font-size: 14px;
  margin-bottom: 14px;
}

.modal-body input[type="password"] {
  width: 100%;
  background-color: var(--bg-app);
  border: 1px solid var(--border-card);
  color: var(--color-text-primary);
  padding: 12px 14px;
  border-radius: var(--border-radius-sm);
  font-size: 15px;
  transition: var(--transition-fast);
}

.modal-body input[type="password"]:focus {
  outline: none;
  border-color: var(--color-primary);
}

.error-msg {
  color: var(--color-danger);
  font-size: 12px;
  margin-top: 8px;
  font-weight: 500;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Toast Messages */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: var(--bg-card);
  color: var(--color-text-primary);
  border: 1px solid var(--border-card);
  padding: 12px 24px;
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  animation: toastEnter 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.toast-success {
  border-left: 4px solid var(--color-success);
}

.toast.toast-error {
  border-left: 4px solid var(--color-danger);
}

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

/* Utility Helpers */
.hidden {
  display: none !important;
}

/* Footer Styles */
.app-footer {
  text-align: center;
  padding: 24px 0;
  border-top: 1px solid var(--border-card);
  color: var(--color-text-muted);
  font-size: 12px;
}
