/* public/css/styles.css - Modern, responsive design */

:root {
  /* Light theme colors */
  --primary-color: #4f46e5;
  --primary-hover: #4338ca;
  --secondary-color: #6b7280;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --info-color: #3b82f6;
  
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --border-color: #e5e7eb;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  
  --border-radius: 0.75rem;
  --border-radius-sm: 0.5rem;
  --border-radius-lg: 1rem;
  
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark theme colors */
[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --border-color: #475569;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
}

* {
  box-sizing: border-box;
}

body {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  transition: var(--transition);
}

/* Enhanced Container */
.main-container {
  min-height: calc(100vh - 76px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

/* Modern Card Design */
.modern-card {
  background: var(--bg-primary);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  padding: 2.5rem;
  width: 100%;
  max-width: 500px;
  transition: var(--transition);
}

.modern-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* Enhanced Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.form-control {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 1rem;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgb(79 70 229 / 0.1);
  background: var(--bg-primary);
}

.form-control:hover {
  border-color: var(--text-secondary);
}

.form-control.is-invalid {
  border-color: var(--danger-color);
  box-shadow: 0 0 0 3px rgb(239 68 68 / 0.1);
}

.form-control.is-valid {
  border-color: var(--success-color);
  box-shadow: 0 0 0 3px rgb(16 185 129 / 0.1);
}

/* Enhanced Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.5rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  min-height: 48px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, var(--primary-hover) 0%, #3730a3 100%);
}

.btn-primary:active {
  transform: translateY(0);
}

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

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

.btn-success {
  background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
  color: white;
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
  color: white;
}

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

.btn-loading {
  color: transparent;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Enhanced Alerts */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--border-radius);
  border: none;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
}

.alert-success {
  background: rgb(16 185 129 / 0.1);
  color: #065f46;
  border-left: 4px solid var(--success-color);
}

.alert-danger {
  background: rgb(239 68 68 / 0.1);
  color: #991b1b;
  border-left: 4px solid var(--danger-color);
}

.alert-info {
  background: rgb(59 130 246 / 0.1);
  color: #1e40af;
  border-left: 4px solid var(--info-color);
}

.alert-warning {
  background: rgb(245 158 11 / 0.1);
  color: #92400e;
  border-left: 4px solid var(--warning-color);
}

[data-theme="dark"] .alert-success {
  background: rgb(16 185 129 / 0.2);
  color: #6ee7b7;
}

[data-theme="dark"] .alert-danger {
  background: rgb(239 68 68 / 0.2);
  color: #fca5a5;
}

[data-theme="dark"] .alert-info {
  background: rgb(59 130 246 / 0.2);
  color: #93c5fd;
}

[data-theme="dark"] .alert-warning {
  background: rgb(245 158 11 / 0.2);
  color: #fbbf24;
}

/* Modern Navbar */
.navbar {
  background: var(--bg-primary) !important;
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
  transition: var(--transition);
}

.navbar-brand {
  font-weight: 700;
  color: var(--text-primary) !important;
  font-size: 1.25rem;
}

.nav-link {
  color: var(--text-secondary) !important;
  font-weight: 500;
  transition: var(--transition);
  border-radius: var(--border-radius-sm);
  margin: 0 0.25rem;
  padding: 0.5rem 0.75rem !important;
}

.nav-link:hover {
  color: var(--primary-color) !important;
  background: rgb(79 70 229 / 0.1);
}

/* Enhanced Tables */
.table-container {
  background: var(--bg-primary);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  margin-bottom: 2rem;
}

.table {
  margin: 0;
  background: transparent;
}

.table th {
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: 600;
  border: none;
  padding: 1rem;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.table td {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: middle;
}

.table-striped tbody tr:nth-of-type(odd) {
  background: var(--bg-secondary);
}

/* Dark Mode Toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.theme-toggle:hover {
  background: var(--bg-secondary);
}

.form-switch .form-check-input {
  width: 3rem;
  height: 1.5rem;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  transition: var(--transition);
}

.form-switch .form-check-input:checked {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.form-switch .form-check-input:focus {
  box-shadow: 0 0 0 3px rgb(79 70 229 / 0.2);
}

/* Page Headers */
.page-header {
  text-align: center;
  margin-bottom: 2rem;
}

.page-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 1.125rem;
}

/* Character Counter */
.char-counter {
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.char-counter.warning {
  color: var(--warning-color);
}

.char-counter.danger {
  color: var(--danger-color);
}

/* Loading States */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgb(0 0 0 / 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--bg-tertiary);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Form Validation */
.field-error {
  color: var(--danger-color);
  font-size: 0.75rem;
  margin-top: 0.25rem;
  display: block;
}

.field-success {
  color: var(--success-color);
  font-size: 0.75rem;
  margin-top: 0.25rem;
  display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
  .modern-card {
    padding: 1.5rem;
    margin: 1rem;
  }
  
  .main-container {
    padding: 1rem;
  }
  
  .page-title {
    font-size: 1.5rem;
  }
  
  .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }
  
  .table-container {
    overflow-x: auto;
  }
}

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

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

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in {
  animation: slideIn 0.4s ease-out;
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-secondary);
}

.mb-4 {
  margin-bottom: 1.5rem;
}

.mt-4 {
  margin-top: 1.5rem;
}

.d-flex {
  display: flex;
}

.align-items-center {
  align-items: center;
}

.justify-content-center {
  justify-content: center;
}

.gap-2 {
  gap: 0.5rem;
}

.w-100 {
  width: 100%;
}

/* Focus indicators for accessibility */
*:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}