/* Custom CSS for Python Setu Light - Bulma-based Design System */

/* Import Inter font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Design System Variables */
:root {
  /* Couleurs primaires selon la charte graphique officielle */
  --primary: #2563EB;       /* Bleu vif et engageant (CTA, liens) */
  --primary-light: #60A5FA;  /* Bleu plus clair pour les dégradés */
  --primary-dark: #1D4ED8;   /* Bleu plus sombre pour les :hover */
  --secondary: #FBBF24;     /* Jaune/or chaud (CTA alternatif) */
  
  /* Couleurs spécifiques admin section */
  --admin-sidebar: #0D63C6;  /* Bleu professionnel sidebar admin */
  --admin-bg: #F7F8FA;       /* Fond principal admin */
  --admin-content: #FFFFFF;  /* Fond cartes et tableaux admin */
  
  /* Couleurs de statut selon la charte */
  --status-warning: #FFC107; /* Jaune vif (Alerte, En attente) */
  --status-info: #4A90E2;    /* Bleu clair (Information) */
  --status-success: #28A745; /* Vert vif (Succès, Approuvé) */
  --status-neutral: #E9ECEF; /* Gris neutre (Données secondaires) */
  --status-danger: #ED1C24;  /* Rouge (Danger, Rejeté) */
  
  /* Background Colors selon la charte */
  --bg-primary: linear-gradient(135deg, var(--primary), var(--secondary));
  --bg-card: #ffffff;
  --bg-light: #F8F9FA;          /* Sections alternées selon charte */
  --bg-footer: #1A202C;         /* Footer bleu nuit très foncé */
  
  /* Couleurs de texte selon la charte */
  --text-primary: #1F2937;      /* Gris très foncé pour corps de texte */
  --text-secondary: #6B7280;    /* Gris plus clair pour sous-titres */
  --text-admin: #212529;        /* Texte admin section */
  
  /* Neutral Colors */
  --dark: #1F2937;
  --dark-light: #6B7280;
  --grey: #9CA3AF;
  --grey-light: #E5E7EB;
  --light: #F8F9FA;
  --white: #ffffff;
  
  /* Couleurs de Statut (selon la charte officielle) */
  --success: var(--status-success);
  --warning: var(--status-warning);
  --danger: var(--status-danger);
  --info: var(--status-info);
  
  /* Typography selon la charte graphique */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-base: 16px;
  --line-height-base: 1.6;
  
  /* Hiérarchie de typographie marquée */
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-xxl: 3rem;
  
  /* Border Radius selon la charte */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;      /* Cartes selon charte */
  --radius-xl: 16px;
  --radius-button: 8px;   /* Boutons selon charte admin */
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.35s ease;
}

/* Base Typography selon la charte */
html {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
}

body {
  color: var(--text-primary);
  font-family: var(--font-family);
}

/* Hiérarchie typographique marquée selon la charte */
.title {
  color: var(--text-primary);
  font-weight: var(--font-weight-bold);
}

.subtitle {
  color: var(--text-secondary);
  font-weight: var(--font-weight-normal);
}

.title.is-1 {
  font-size: 3rem;
  font-weight: var(--font-weight-bold);
}

.title.is-2 {
  font-size: 2.5rem;
  font-weight: var(--font-weight-bold);
}

.title.is-3 {
  font-size: 2rem;
  font-weight: var(--font-weight-semibold);
}

/* Texte corps lisible selon la charte */
p, .content {
  color: var(--text-primary);
  font-weight: var(--font-weight-normal);
}

/* Texte admin section */
.admin-layout .title,
.admin-layout .subtitle,
.admin-layout p {
  color: var(--text-admin);
}

/* Override Bulma Colors */
.has-background-primary {
  background-color: var(--primary) !important;
}

.has-text-primary {
  color: var(--primary) !important;
}

.button.is-primary {
  background-color: var(--primary);
  border-color: var(--primary);
  transition: all var(--transition-normal);
}

.button.is-primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.button.is-primary:focus {
  box-shadow: 0 0 0 0.125em rgba(0, 119, 200, 0.25);
}

/* Custom Button Styles */
.button {
  font-family: var(--font-family);
  font-weight: 500;
  border-radius: var(--radius-button);
  transition: all var(--transition-normal);
}

/* Bouton secondaire selon la charte */
.button.is-secondary {
  background-color: var(--secondary);
  border-color: var(--secondary);
  color: var(--text-primary);
}

.button.is-secondary:hover {
  background-color: #F59E0B;
  border-color: #F59E0B;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.button:hover {
  transform: translateY(-1px);
}

.button.is-rounded {
  border-radius: var(--radius-xl);
}

/* Custom Card Styles selon la charte */
.card {
  border-radius: var(--radius-lg);    /* 12px selon charte */
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  border: 1px solid var(--grey-light); /* Bordure fine selon charte */
  background: white;
}

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

.card-header {
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
}

.card-header-title {
  color: white;
  font-weight: 600;
}

/* Hero Section Styles */
.hero {
  position: relative;
  overflow: hidden;
}

.hero.is-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

.hero-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, var(--secondary) 100%);
}

.hero-body {
  position: relative;
  z-index: 2;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  z-index: 1;
}

/* Navigation Styles */
.navbar {
  box-shadow: var(--shadow-sm);
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
}

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

.navbar-item:hover {
  background-color: rgba(0, 119, 200, 0.1);
  color: var(--primary);
}

/* Link Styles */
a {
  color: var(--primary);
  transition: color var(--transition-normal);
}

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

/* Form Styles */
.input, .textarea, .select select {
  border-radius: var(--radius-md);
  border: 2px solid var(--grey-light);
  transition: all var(--transition-normal);
}

.input:focus, .textarea:focus, .select select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.125em rgba(0, 119, 200, 0.25);
}

.field.has-addons .control .button {
  border-radius: 0;
}

.field.has-addons .control:first-child .button {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.field.has-addons .control:last-child .button {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* Table Styles */
.table {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table thead th {
  background-color: var(--light);
  color: var(--dark);
  font-weight: 600;
  border-color: var(--grey-light);
}

.table tbody tr:hover {
  background-color: rgba(0, 119, 200, 0.05);
}

/* Tag Styles */
.tag {
  border-radius: var(--radius-sm);
  font-weight: 500;
}

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

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

.tag.is-warning {
  background-color: var(--warning);
  color: white;
}

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

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

/* Notification Styles */
.notification {
  border-radius: var(--radius-lg);
  border-left: 4px solid;
}

.notification.is-primary {
  border-left-color: var(--primary);
}

.notification.is-success {
  border-left-color: var(--success);
}

.notification.is-warning {
  border-left-color: var(--warning);
}

.notification.is-danger {
  border-left-color: var(--danger);
}

/* Modal Styles */
.modal-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.modal-card-head {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
}

.modal-card-title {
  color: white;
}

/* Sidebar Styles */
.sidebar {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
  min-height: 100vh;
  color: white;
}

/* Admin Sidebar selon la charte */
.sidebar.admin-sidebar {
  background: var(--admin-sidebar);
  min-height: 100vh;
  color: white;
}

/* Admin Layout selon la charte */
.admin-layout {
  background-color: var(--admin-bg);
  min-height: 100vh;
}

.admin-content {
  background-color: var(--admin-content);
  border-radius: 8px;
  border: 1px solid var(--grey-light);
}

.sidebar .menu-label {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.sidebar .menu-list a {
  color: rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-xs);
  transition: all var(--transition-normal);
}

.sidebar .menu-list a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
  transform: translateX(4px);
}

.sidebar .menu-list a.is-active {
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  font-weight: 600;
}

/* Utility Classes */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }

.transition-fast { transition: all var(--transition-fast); }
.transition-normal { transition: all var(--transition-normal); }
.transition-slow { transition: all var(--transition-slow); }

/* Responsive Typography */
@media screen and (max-width: 768px) {
  .title.is-1 { font-size: 2rem; }
  .title.is-2 { font-size: 1.75rem; }
  .title.is-3 { font-size: 1.5rem; }
  .subtitle.is-4 { font-size: 1.125rem; }
}

/* Feature Cards */
.feature-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  border: 1px solid rgba(0, 0, 0, 0.05);
  height: 100%;
}

.feature-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.feature-icon {
  width: 4rem;
  height: 4rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  margin-bottom: var(--spacing-lg);
}

/* Testimonial Cards */
.testimonial-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--primary);
  position: relative;
}

.testimonial-card::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: var(--spacing-lg);
  font-size: 4rem;
  color: var(--primary);
  font-family: Georgia, serif;
  opacity: 0.3;
}

/* Quick Action Cards */
.quick-action-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  transition: all var(--transition-normal);
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: block;
}

.quick-action-card.is-secondary {
  background: linear-gradient(135deg, var(--secondary) 0%, #ffd666 100%);
  color: #333;
}

.quick-action-card.is-orange {
  background: linear-gradient(135deg, var(--accent-orange) 0%, #ffab5a 100%);
  color: white;
}

.quick-action-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: white;
}

.quick-action-icon {
  font-size: 2rem;
  margin-bottom: var(--spacing-md);
}

/* Loading States */
.is-loading {
  position: relative;
  pointer-events: none;
}

.is-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1rem;
  height: 1rem;
  margin-top: -0.5rem;
  margin-left: -0.5rem;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* Accessibility Improvements */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Focus States */
*:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.button:focus,
.input:focus,
.textarea:focus,
.select select:focus {
  outline: none;
}

/* Dark Mode Ready */
@media (prefers-color-scheme: dark) {
  :root {
    --white: #1a1a1a;
    --light: #2d2d2d;
    --grey-light: #404040;
    --grey: #666666;
    --dark-light: #cccccc;
    --dark: #ffffff;
  }
}

/* Additional Components from New Design */

/* Body Layout */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: var(--font-family);
}

.main-content {
  flex: 1;
}

/* Enhanced Navbar */
.navbar {
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar-item img {
  max-height: 2.5rem;
}

/* Stats Cards */
.stats-card .card-content {
  padding: 1.5rem;
  text-align: center;
}

.stats-value {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--primary);
  display: block;
}

.stats-label {
  color: #666;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 0.5rem;
}

/* Step Indicator */
.step-indicator {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.step {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #ddd;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 10px;
  position: relative;
  font-weight: bold;
  transition: all var(--transition-normal);
}

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

.step.completed {
  background-color: var(--primary-light);
  color: white;
}

.step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 100%;
  width: 20px;
  height: 2px;
  background-color: #ddd;
  transition: all var(--transition-normal);
}

.step.completed:not(:last-child)::after {
  background-color: var(--primary-light);
}

/* Form Sections */
.form-section {
  display: none;
}

.form-section.active {
  display: block;
  animation: fadeIn 0.5s ease;
}

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

/* User Table */
.user-table {
  width: 100%;
}

.user-table th {
  background-color: var(--light);
}

/* Chart Container */
.chart-container {
  position: relative;
  height: 250px;
  width: 100%;
}

/* Enhanced Footer */
footer.footer {
  background-color: var(--dark);
  color: white;
  padding: 2rem 1.5rem;
}

.footer-links a {
  color: #aaa;
  margin-right: 1rem;
  transition: color var(--transition-normal);
}

.footer-links a:hover {
  color: white;
}

/* Error and Success Messages */
.error-message {
  color: var(--danger);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.success-message {
  background-color: var(--success);
  color: white;
  padding: 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  display: none;
  animation: slideIn 0.3s ease;
}

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

/* Enhanced Card Hover Effects */
.card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px rgba(0,0,0,0.1);
}

/* Enhanced Testimonial Cards */
.testimonial-card {
  border-left: 4px solid var(--primary);
  padding: var(--spacing-xl);
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  height: 100%;
  transition: all var(--transition-normal);
}

.testimonial-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Feature Cards Enhancement */
.feature-card {
  text-align: center;
  padding: var(--spacing-xxl) var(--spacing-xl);
}

.feature-card .feature-icon {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 1rem;
  width: auto;
  height: auto;
  background: none;
  display: block;
}

/* Sections selon la charte graphique */
.section.has-background-grey-light {
  background-color: var(--bg-light);
}

/* Footer selon la charte */
.footer.is-dark {
  background-color: var(--bg-footer);
  color: white;
}

/* KPI Cards pour admin selon la charte */
.kpi-card {
  display: flex;
  align-items: center;
  padding: 1.5rem;
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--grey-light);
}

.kpi-card.is-warning {
  border-left: 4px solid var(--status-warning);
}

.kpi-card.is-info {
  border-left: 4px solid var(--status-info);
}

.kpi-card.is-success {
  border-left: 4px solid var(--status-success);
}

.kpi-card.is-neutral {
  border-left: 4px solid var(--status-neutral);
}

.kpi-icon {
  font-size: 2rem;
  margin-right: 1rem;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.kpi-icon.is-warning {
  background-color: var(--status-warning);
  color: white;
}

.kpi-icon.is-info {
  background-color: var(--status-info);
  color: white;
}

.kpi-icon.is-success {
  background-color: var(--status-success);
  color: white;
}

.kpi-icon.is-neutral {
  background-color: var(--status-neutral);
  color: var(--text-primary);
}

/* Print Styles */
@media print {
  .sidebar,
  .navbar,
  .button,
  .modal {
    display: none !important;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}