/* Variables */
:root {
  /* Couleurs */
  --color-primary: #4f46e5;
  --color-primary-light: #eef2ff;
  --color-primary-hover: #4338ca;
  --color-secondary: #f8fafc;
  --color-success: #10b981;
  --color-success-light: #d1fae5;
  --color-danger: #ef4444;
  --color-danger-light: #fee2e2;
  --color-purple: #8b5cf6;
  --color-purple-light: #f3e8ff;
  
  /* Texte */
  --color-text: #1e293b;
  --color-text-light: #64748b;
  --color-text-lighter: #94a3b8;
  
  /* Fond */
  --color-white: #ffffff;
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;

  /* Layout */
  --radius: 0.5rem;
  --spacing: 1rem;
  --font-size: 16px;
  --use-animations: all;
}

/* Base */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  background-color: var(--color-secondary);
  color: var(--color-text);
  line-height: 1.5;
  overflow: hidden;
  font-size: var(--font-size);
}

#app {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Layout */
.page-header {
  background-color: var(--color-white);
  border-bottom: 1px solid var(--color-gray-200);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo i {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--color-primary);
}

.app-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
}

.main-content {
  flex: 1;
  overflow: hidden;
  padding: var(--spacing);
  min-height: 0;
}

/* Navigation */
.nav-tabs {
  display: flex;
  gap: 0.75rem;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  background-color: transparent;
}

.nav-tab i {
  width: 1.25rem;
  height: 1.25rem;
}

.nav-tab span {
  white-space: nowrap;
}

.nav-tab.active {
  background-color: var(--color-primary);
  color: var(--color-white);
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.1);
}

.nav-tab:not(.active) {
  color: var(--color-text-light);
}

.nav-tab:not(.active):hover {
  background-color: var(--color-gray-100);
  color: var(--color-text);
}

/* Boutons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  touch-action: manipulation;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
  background-color: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(79, 70, 229, 0.1);
}

.btn-secondary {
  background-color: var(--color-gray-100);
  color: var(--color-text);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--color-gray-200);
  transform: translateY(-1px);
}

.btn-icon-only {
  padding: 0.375rem;
  border-radius: 9999px;
  min-width: 1.75rem;
  min-height: 1.75rem;
}

.btn-full {
  width: 100%;
}

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

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

/* Formulaires */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: var(--spacing);
}

.form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
}

.form-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--color-text);
  background-color: var(--color-white);
  transition: all 0.2s;
}

.form-input:hover {
  border-color: var(--color-primary);
}

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

.form-help {
  font-size: 0.75rem;
  color: var(--color-text-light);
}

/* Notifications */
.notification {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
}

.notification-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  animation: slideIn 0.3s ease-out;
  font-size: 0.875rem;
}

.notification-content.success {
  background-color: var(--color-success-light);
  color: var(--color-success);
}

.notification-content.error {
  background-color: var(--color-danger-light);
  color: var(--color-danger);
}

/* États */
.loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 3rem;
  color: var(--color-text-light);
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.loading-indicator i {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--color-primary);
  animation: spin 1s linear infinite;
}

.error-state {
  text-align: center;
  padding: 3rem;
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.error-icon {
  width: 4rem;
  height: 4rem;
  background: var(--color-danger-light);
  border-radius: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

.error-icon i {
  width: 2rem;
  height: 2rem;
  color: var(--color-danger);
}

.error-state h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.75rem;
}

.error-state p {
  color: var(--color-text-light);
  margin-bottom: 1.5rem;
}

/* Modales */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing);
  z-index: 100;
}

.modal-content {
  background: var(--color-white);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  animation: modalSlideIn 0.3s ease-out;
  max-height: 90vh;
  width: 100%;
  max-width: 32rem;
  position: relative;
  z-index: 101;
}

.modal-header {
  padding: var(--spacing);
  background: linear-gradient(to right, var(--color-primary-light), var(--color-white));
  border-bottom: 1px solid var(--color-gray-200);
  position: relative;
  z-index: 2;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
  padding-right: 3rem;
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: var(--radius);
  border: none;
  background: var(--color-white);
  cursor: pointer;
  color: var(--color-text-light);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.modal-close:hover {
  background-color: var(--color-danger-light);
  color: var(--color-danger);
  transform: rotate(90deg);
}

.modal-close i {
  width: 1.25rem;
  height: 1.25rem;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
}

.modal-footer {
  padding: var(--spacing);
  border-top: 1px solid var(--color-gray-200);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: var(--color-white);
  position: relative;
  z-index: 2;
}

/* Animations */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

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

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

/* Responsive */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
  }

  .nav-tabs {
    width: 100%;
    justify-content: space-between;
    gap: 0.5rem;
  }

  .nav-tab {
    flex: 1;
    padding: 0.625rem;
    justify-content: center;
  }

  .nav-tab span {
    display: none;
  }

  .nav-tab i {
    width: 1.5rem;
    height: 1.5rem;
    margin: 0;
  }

  .main-content {
    padding: 0.75rem;
  }

  .notification {
    top: auto;
    bottom: calc(50vh + 1rem);
    left: 1rem;
    right: 1rem;
  }

  .notification-content {
    width: 100%;
    box-sizing: border-box;
  }

  .modal {
    padding: 0;
  }

  .modal-content {
    height: 100vh;
    max-height: none;
    border-radius: 0;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 1rem;
  }

  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
  }

  .form-input {
    padding: 0.625rem;
  }
}

@media (max-width: 480px) {
  .header-content {
    padding: 0.5rem;
  }

  .nav-tab {
    padding: 0.5rem;
  }

  .nav-tab i {
    width: 1.25rem;
    height: 1.25rem;
  }

  .main-content {
    padding: 0.5rem;
  }

  .btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
  }

  .btn-icon-only {
    padding: 0.375rem;
    min-width: 1.5rem;
    min-height: 1.5rem;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 0.75rem;
  }

  .form-input {
    padding: 0.5rem;
    font-size: 0.8125rem;
  }

  .error-state {
    padding: 2rem 1rem;
  }

  .error-icon {
    width: 3rem;
    height: 3rem;
  }

  .error-icon i {
    width: 1.5rem;
    height: 1.5rem;
  }

  .error-state h3 {
    font-size: 1.125rem;
  }
}