/* ============================================
   MAIN STYLESHEET - Professional Structure
   ============================================ */

/* ===== CSS VARIABLES & THEMES ===== */
:root {
  /* Modern Dark Theme (Default) */
  --primary: #6366F1;
  --primary-dark: #4F46E5;
  --primary-light: #64B5F6;

  --text: #F8FAFC;
  --text-light: #CBD5E1;
  --text-muted: #94A3B8;
  --bg: #0F172A;
  --surface: #1E293B;
  --surface-variant: #334155;
  --surface-dark: #0F172A;
  --border: #334155;
  --border-light: #475569;
  --shadow: rgba(0, 0, 0, 0.4);
  --shadow-lg: rgba(0, 0, 0, 0.6);
  --success: #10B981;
  --error: #EF4444;
  --on-surface: #F8FAFC;
  --on-background: #F8FAFC;
  
  /* Additional theme colors */
  --accent: #3b82f6;
  --accent-light: #60a5fa;
  --accent-dark: #2563eb;
  --muted: #9ca3af;
  --secondary: #03A9F4;
}

/* Modern Light Theme */
[data-theme="light"] {
  --primary: #6366F1;
  --primary-dark: #4F46E5;
  --primary-light: #64B5F6;

  --text: #0F172A;
  --text-light: #475569;
  --text-muted: #64748B;
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-variant: #F1F5F9;
  --surface-dark: #E2E8F0;
  --border: #E2E8F0;
  --border-light: #CBD5E1;
  --shadow: rgba(0, 0, 0, 0.08);
  --shadow-lg: rgba(0, 0, 0, 0.15);
  --success: #10B981;
  --error: #EF4444;
  --on-surface: #0F172A;
  --on-background: #0F172A;
  
  --accent: #3b82f6;
  --accent-light: #60a5fa;
  --accent-dark: #2563eb;
  --muted: #666;
  --secondary: #03A9F4;
}

/* Color Themes */
[data-color-theme="blue"] {
  --primary: #2196F3;
  --primary-dark: #1976D2;
  --primary-light: #64B5F6;
  --accent: #2196F3;
  --accent-light: #64B5F6;
  --accent-dark: #1976D2;
}

[data-color-theme="purple"] {
  --primary: #9C27B0;
  --primary-dark: #7B1FA2;
  --primary-light: #BA68C8;
  --accent: #9C27B0;
  --accent-light: #BA68C8;
  --accent-dark: #7B1FA2;
}

[data-color-theme="green"] {
  --primary: #4CAF50;
  --primary-dark: #388E3C;
  --primary-light: #81C784;
  --accent: #4CAF50;
  --accent-light: #81C784;
  --accent-dark: #388E3C;
}

[data-color-theme="orange"] {
  --primary: #FF9800;
  --primary-dark: #F57C00;
  --primary-light: #FFB74D;
  --accent: #FF9800;
  --accent-light: #FFB74D;
  --accent-dark: #F57C00;
}

[data-color-theme="red"] {
  --primary: #F44336;
  --primary-dark: #D32F2F;
  --primary-light: #E57373;
  --accent: #F44336;
  --accent-light: #E57373;
  --accent-dark: #D32F2F;
}

[data-color-theme="pink"] {
  --primary: #E91E63;
  --primary-dark: #C2185B;
  --primary-light: #F48FB1;
  --accent: #E91E63;
  --accent-light: #F48FB1;
  --accent-dark: #C2185B;
}

[data-color-theme="teal"] {
  --primary: #009688;
  --primary-dark: #00796B;
  --primary-light: #4DB6AC;
  --accent: #009688;
  --accent-light: #4DB6AC;
  --accent-dark: #00796B;
}

[data-color-theme="indigo"] {
  --primary: #3F51B5;
  --primary-dark: #303F9F;
  --primary-light: #7986CB;
  --accent: #3F51B5;
  --accent-light: #7986CB;
  --accent-dark: #303F9F;
}

/* ===== RESET & BASE STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}

body {
  margin: 0;
  min-height: 100vh;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background-color: rgba(100, 100, 100, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: rgba(100, 100, 100, 0.5);
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 0.5em;
  color: var(--on-surface);
}

/* ===== BUTTONS ===== */
button {
  cursor: pointer;
  border: none;
  outline: none;
  font-family: inherit;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--primary, #2196F3);
  color: white;
  padding: 9px 15px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark, #1976D2);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s;
  font-size: 14px;
}

.btn-secondary:hover {
  background: var(--surface);
  border-color: var(--border-light);
}

.btn-danger {
  background: #ef4444;
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s;
  font-size: 13px;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-small {
  padding: 4px 8px;
  font-size: 12px;
}

.btn-edit {
  background: var(--accent);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s;
  font-size: 13px;
  margin-right: 5px;
}

.btn-edit:hover {
  opacity: 0.9;
}

/* ===== FORMS ===== */
input, select, textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 15px;
  width: 100%;
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.2s, outline 0.2s, background 0.3s;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
}

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

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--text);
  font-size: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

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

.form-group-modern label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
}

.form-group-modern input,
.form-group-modern select,
.form-group-modern textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  transition: all 0.2s;
}

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

.form-group-modern textarea {
  resize: vertical;
  min-height: 100px;
}

/* ===== CARDS ===== */
.card {
  background: var(--surface);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px var(--shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  opacity: 0;
  transition: opacity 0.3s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px var(--shadow-lg);
  border-color: var(--primary);
}

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

.card h2 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: var(--on-surface);
  font-weight: 500;
  letter-spacing: -0.02em;
  text-align: center;
}

.card h3 {
  font-size: 1.2rem;
  margin-bottom: 12px;
  color: var(--on-surface);
  font-weight: 500;
  text-align: center;
}

.modern-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--border);
  margin-top: 30px;
}

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

.card-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

/* ===== UTILITY CLASSES ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 15px;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 5px; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 20px; }
.mt-4 { margin-top: 30px; }
.mb-1 { margin-bottom: 5px; }
.mb-2 { margin-bottom: 10px; }
.mb-3 { margin-bottom: 20px; }
.p-2 { padding: 10px; }
.p-3 { padding: 20px; }
.rounded { border-radius: 8px; }
.shadow { box-shadow: 0 2px 6px rgba(0,0,0,0.05); }
.hidden { display: none !important; }

.error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 15px;
  font-size: 14px;
  border: 1px solid var(--error);
}

.success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 15px;
  font-size: 14px;
  border: 1px solid var(--success);
}

.loading,
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

.loader {
  margin: 50px auto;
  border: 4px solid var(--border);
  border-top: 4px solid var(--accent);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  animation: spin 0.8s linear infinite;
}

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

/* ===== TABLES ===== */
.table-wrapper {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  margin-top: 30px;
  padding: 18px;
  overflow-x: auto;
  border: 1px solid var(--border);
}

.table-wrapper h3 {
  margin-bottom: 15px;
  font-size: 17px;
  color: var(--text);
  font-weight: 600;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

th {
  text-align: left;
  background: var(--bg);
  color: var(--muted);
  font-weight: 600;
  padding: 12px;
  border-bottom: 2px solid var(--border);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

tr:hover td {
  background: var(--bg);
}

tr:last-child td {
  border-bottom: none;
}

/* ===== STATUS BADGES ===== */
.status-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-pending {
  background: rgba(251, 191, 36, 0.2);
  color: #f59e0b;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.status-confirmed {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.status-completed {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-cancelled {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

[data-theme="dark"] .status-pending {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

[data-theme="dark"] .status-confirmed {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

[data-theme="dark"] .status-completed {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

[data-theme="dark"] .status-cancelled {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

/* ===== MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal {
  background: var(--surface);
  border-radius: 16px;
  padding: 32px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.9);
  transition: transform 0.3s ease;
  border: 1px solid var(--border);
}

.modal-overlay.active .modal {
  transform: scale(1);
}

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

.modal-header h4 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s;
}

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

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

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ===== ANIMATIONS ===== */
.fade-in {
  animation: fadeIn 0.3s ease-in;
}

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

/* ===== SPECIFIC STYLES ===== */
/* Public and Dashboard styles are loaded separately in HTML */

