/* ========================================
   STYLE.CSS - BASE/GENERAL STYLES
   Used across ALL pages of the application
   ======================================== */

/* Import elegant fonts from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

/* ========================================
   CSS VARIABLES - Design Tokens
   ======================================== */
:root {
  /* Main Color Palette */
  --primary-color: #939293;        /* Soft purple */
  --primary-hover: #7a4d82;
  --secondary-color: #d0c8c8;      /* Pale pink */
  --accent-color: #f6eeec;         /* Warm beige */
  
  /* Text Colors */
  --text-dark: #2f1f1a;            /* Dark brown */
  --text-light: #605047;           /* Light brown */
  --text-muted: #6c757d;
  
  /* Background Colors */
  --white: #FFFFFF;
  --light-bg: #FDFBF7;             /* Very light background */
  --gray-50: #f8f9fa;
  --gray-100: #e9ecef;
  --gray-200: #dee2e6;
  --gray-300: #ced4da;
  --gray-400: #adb5bd;
  --gray-500: #6c757d;
  --gray-600: #495057;
  --gray-700: #343a40;
  --gray-800: #212529;
  
  /* Status Colors */
  --success-color: #28a745;
  --success-light: #d4edda;
  --danger-color: #ff0000;
  --danger-light: #f8d7da;
  --warning-color: #ffc107;
  --warning-light: #fff3cd;
  --info-color: #17a2b8;
  --info-light: #cce5ff;
  
  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.15);
  --shadow-hover: rgba(142, 119, 148, 0.2);
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, rgb(190, 190, 190) 0%, #000000 100%);
  --gradient-secondary: linear-gradient(135deg, #f8edec 0%, #FFFFFF 100%);
  --gradient-accent: linear-gradient(135deg, #d5d5d5 0%, #f1e2d5 100%);
  
  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 12px;
  --spacing-lg: 16px;
  --spacing-xl: 20px;
  --spacing-xxl: 24px;
  --spacing-xxxl: 32px;
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-xxl: 16px;
  --radius-round: 50px;
  --radius-full: 50%;
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  
  /* Typography */
  --font-primary: 'Playfair Display', serif;
  --font-secondary: 'Inter', sans-serif;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-secondary);
  background: var(--light-bg);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-primary);
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 1rem;
  line-height: 1.3;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

h5 {
  font-size: 1.1rem;
}

h6 {
  font-size: 1rem;
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-hover);
}

/* ========================================
   LAYOUT UTILITIES
   ======================================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-full {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Flexbox Utilities */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

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

.items-start {
  align-items: flex-start;
}

.items-end {
  align-items: flex-end;
}

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

.justify-between {
  justify-content: space-between;
}

.justify-end {
  justify-content: flex-end;
}

.gap-xs { gap: var(--spacing-xs); }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }
.gap-xl { gap: var(--spacing-xl); }

/* Grid Utilities */
.grid {
  display: grid;
  gap: var(--spacing-lg);
}

.grid-auto-fit {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* Text Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }

/* ========================================
   BUTTONS - Base Styles
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md) var(--spacing-xl);
  border: none;
  border-radius: var(--radius-lg);
  font-family: var(--font-secondary);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

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

/* Button Variants */
.btn-primary {
  background: var(--gradient-primary);
  color: var(--white);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
  background: var(--gray-600);
  color: var(--white);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--gray-700);
}

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

.btn-success:hover:not(:disabled) {
  background: #218838;
}

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

.btn-danger:hover:not(:disabled) {
  background: #c82333;
}

.btn-info {
  background: var(--info-color);
  color: var(--white);
}

.btn-info:hover:not(:disabled) {
  background: #138496;
}

.btn-warning {
  background: var(--warning-color);
  color: var(--text-dark);
}

.btn-light {
  background: var(--gray-50);
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
}

.btn-light:hover:not(:disabled) {
  background: var(--gray-100);
}

.btn-white {
  background: var(--white);
  color: var(--primary-color);
  border: 1px solid var(--gray-200);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-outline:hover:not(:disabled) {
  background: var(--primary-color);
  color: var(--white);
}

/* Button Sizes */
.btn-sm {
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: 0.875rem;
}

.btn-lg {
  padding: var(--spacing-lg) var(--spacing-xxl);
  font-size: 1.1rem;
}

.btn-xl {
  padding: var(--spacing-xl) var(--spacing-xxxl);
  font-size: 1.2rem;
}

/* Button with icon */
.btn i {
  font-size: 1em;
}

/* Small action buttons */
.btn-icon {
  padding: var(--spacing-sm);
  border-radius: var(--radius-md);
  background: none;
  box-shadow: none;
}

.btn-icon:hover {
  background: var(--gray-100);
}

.btn-icon.edit { color: var(--primary-color); }
.btn-icon.delete { color: var(--danger-color); }

/* ========================================
   FORM ELEMENTS
   ======================================== */
.form-group {
  margin-bottom: var(--spacing-xl);
}

.form-label,
label {
  display: block;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: var(--spacing-sm);
  font-size: 0.95rem;
}

.form-label i,
label i {
  color: var(--primary-color);
  margin-right: var(--spacing-xs);
}

.form-control,
input,
select,
textarea {
  width: 100%;
  padding: var(--spacing-md) var(--spacing-lg);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  font-size: 1rem;
  font-family: var(--font-secondary);
  background: var(--white);
  color: var(--text-dark);
  transition: all var(--transition-fast);
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(147, 146, 147, 0.15);
}

.form-control:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  background: var(--gray-50);
  color: var(--text-muted);
  cursor: not-allowed;
}

.form-control::placeholder,
input::placeholder,
textarea::placeholder {
  color: var(--gray-400);
}

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

.form-help {
  display: block;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: var(--spacing-xs);
}

.form-actions {
  display: flex;
  gap: var(--spacing-md);
  justify-content: flex-end;
  margin-top: var(--spacing-xl);
  padding-top: var(--spacing-lg);
  border-top: 1px solid var(--gray-100);
}

/* ========================================
   CARDS - Base Styles
   ======================================== */
.card {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
  transition: all var(--transition-normal);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: var(--spacing-xl);
  border-bottom: 1px solid var(--gray-100);
  background: var(--gray-50);
}

.card-header h3,
.card-header h4 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.card-header h3 i,
.card-header h4 i {
  color: var(--primary-color);
}

.card-body {
  padding: var(--spacing-xl);
}

.card-footer {
  padding: var(--spacing-lg) var(--spacing-xl);
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
}

/* Card with left border accent */
.card-accent {
  border-left: 4px solid var(--primary-color);
}

.card-accent.success { border-left-color: var(--success-color); }
.card-accent.danger { border-left-color: var(--danger-color); }
.card-accent.warning { border-left-color: var(--warning-color); }
.card-accent.info { border-left-color: var(--info-color); }

/* ========================================
   BADGES / STATUS
   ======================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-md);
  border-radius: var(--radius-round);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-primary {
  background: var(--primary-color);
  color: var(--white);
}

.badge-success {
  background: var(--success-light);
  color: #155724;
}

.badge-danger {
  background: var(--danger-light);
  color: #721c24;
}

.badge-warning {
  background: var(--warning-light);
  color: #856404;
}

.badge-info {
  background: var(--info-light);
  color: #004085;
}

.badge-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
}

.badge-outline {
  background: transparent;
  border: 1px solid currentColor;
}

/* ========================================
   TABLES
   ======================================== */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
}

.table th,
.table td {
  padding: var(--spacing-md) var(--spacing-lg);
  text-align: left;
  border-bottom: 1px solid var(--gray-100);
}

.table th {
  background: var(--gray-50);
  font-weight: 600;
  color: var(--text-dark);
}

.table tbody tr:hover {
  background: var(--gray-50);
}

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

/* ========================================
   LOADING STATES
   ======================================== */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xxxl) var(--spacing-xl);
  text-align: center;
  color: var(--text-muted);
}

.loading i {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: var(--spacing-lg);
}

.loading p {
  margin: 0;
  font-size: 1.1rem;
}

/* Spinner animation */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.fa-spin {
  animation: spin 1s linear infinite;
}

/* ========================================
   ERROR STATES
   ======================================== */
.error {
  background: linear-gradient(135deg, #ff6b6b, #ee5a52);
  color: var(--white);
  padding: var(--spacing-xxl);
  border-radius: var(--radius-xl);
  text-align: center;
  margin: var(--spacing-lg) 0;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.error i {
  font-size: 2.5rem;
  margin-bottom: var(--spacing-md);
  display: block;
}

.error h3 {
  color: var(--white);
  margin: 0 0 var(--spacing-sm) 0;
  font-size: 1.3rem;
}

.error p {
  margin: 0;
  line-height: 1.5;
}

/* ========================================
   EMPTY STATES
   ======================================== */
.empty-state {
  text-align: center;
  padding: var(--spacing-xxxl) var(--spacing-xl);
  color: var(--text-muted);
  background: var(--gray-50);
  border-radius: var(--radius-xl);
  border: 2px dashed var(--gray-200);
}

.empty-state i {
  font-size: 3rem;
  color: var(--gray-300);
  margin-bottom: var(--spacing-lg);
  display: block;
}

.empty-state p {
  margin: 0;
  font-size: 1.1rem;
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--spacing-lg) var(--spacing-xl);
  z-index: 10000;
  transform: translateX(120%);
  transition: transform var(--transition-normal);
  max-width: 350px;
  border-left: 4px solid var(--success-color);
}

.toast.show {
  transform: translateX(0);
}

.toast.toast-success { border-left-color: var(--success-color); }
.toast.toast-error { border-left-color: var(--danger-color); }
.toast.toast-warning { border-left-color: var(--warning-color); }
.toast.toast-info { border-left-color: var(--info-color); }

.toast-content {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.toast-content i {
  font-size: 1.2rem;
}

.toast-success .toast-content i { color: var(--success-color); }
.toast-error .toast-content i { color: var(--danger-color); }
.toast-warning .toast-content i { color: var(--warning-color); }
.toast-info .toast-content i { color: var(--info-color); }

.toast-content span {
  color: var(--text-dark);
  font-weight: 500;
}

/* ========================================
   MODALS / DIALOGS
   ======================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--white);
  border-radius: var(--radius-xl);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.9);
  transition: transform var(--transition-normal);
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-xl);
  border-bottom: 1px solid var(--gray-100);
  background: var(--gray-50);
}

.modal-header h3 {
  margin: 0;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--spacing-sm);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: rgba(220, 53, 69, 0.1);
  color: var(--danger-color);
}

.modal-body {
  padding: var(--spacing-xl);
}

.modal-footer {
  padding: var(--spacing-lg) var(--spacing-xl);
  border-top: 1px solid var(--gray-100);
  display: flex;
  justify-content: flex-end;
  gap: var(--spacing-md);
}

/* Confirmation Dialog */
.confirm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.confirm-overlay.show {
  opacity: 1;
  visibility: visible;
}

.confirm-dialog {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: var(--spacing-xxl);
  max-width: 400px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  transform: scale(0.9);
  transition: transform var(--transition-normal);
}

.confirm-overlay.show .confirm-dialog {
  transform: scale(1);
}

.confirm-content {
  text-align: center;
}

.confirm-content i {
  font-size: 3rem;
  color: var(--warning-color);
  margin-bottom: var(--spacing-lg);
}

.confirm-content h3 {
  color: var(--text-dark);
  margin-bottom: var(--spacing-md);
}

.confirm-content p {
  color: var(--text-muted);
  margin-bottom: var(--spacing-xl);
  line-height: 1.5;
}

.confirm-buttons {
  display: flex;
  gap: var(--spacing-md);
  justify-content: center;
}

/* ========================================
   MESSAGES / ALERTS
   ======================================== */
.message {
  padding: var(--spacing-lg);
  border-radius: var(--radius-lg);
  margin: var(--spacing-md) 0;
  font-weight: 500;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
}

.message.success {
  background: linear-gradient(135deg, #D4EDDA 0%, #C3E6CB 100%);
  color: #155724;
  border-left: 4px solid var(--success-color);
}

.message.error {
  background: linear-gradient(135deg, #F8D7DA 0%, #F5C6CB 100%);
  color: #721C24;
  border-left: 4px solid var(--danger-color);
}

.message.warning {
  background: linear-gradient(135deg, #FFF3CD 0%, #FFEAA7 100%);
  color: #856404;
  border-left: 4px solid var(--warning-color);
}

.message.info {
  background: linear-gradient(135deg, #CCE5FF 0%, #B3D9FF 100%);
  color: #004085;
  border-left: 4px solid var(--info-color);
}

/* ========================================
   SECTIONS
   ======================================== */
section {
  margin: var(--spacing-xxxl) 0;
  padding: var(--spacing-xl) 0;
}

/* Section with description */
.section-description {
  text-align: center;
  color: var(--text-light);
  font-size: 1.1rem;
  margin-bottom: var(--spacing-xxl);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.fade-in { animation: fadeIn 0.6s ease-out; }
.fade-in-up { animation: fadeInUp 0.6s ease-out; }
.fade-in-down { animation: fadeInDown 0.6s ease-out; }
.slide-in-right { animation: slideInRight 0.6s ease-out; }

/* ========================================
   RESPONSIVE UTILITIES
   ======================================== */
@media (max-width: 992px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.35rem; }

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

  .container {
    padding: 0 15px;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
  }

  .modal-content {
    width: 95%;
    margin: 10px;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  .btn {
    padding: var(--spacing-sm) var(--spacing-lg);
  }

  .card-body {
    padding: var(--spacing-lg);
  }

  .toast {
    left: 10px;
    right: 10px;
    max-width: none;
  }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
  .btn,
  .toast,
  .modal-overlay,
  .confirm-overlay {
    display: none !important;
  }

  .card {
    box-shadow: none;
    border: 1px solid var(--gray-200);
  }
}
