/* ====================================
   HOLZEO - STYLES SPÉCIFIQUES PAR PAGE
   ==================================== */

/* ==================
   LOGIN PAGE
   ================== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
  position: relative;
}

.login-page::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(27, 67, 50, 0.9) 0%, rgba(45, 106, 79, 0.8) 100%);
}

.login-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 450px;
  padding: var(--spacing-lg);
}

.login-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--spacing-2xl);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.login-logo {
  max-width: 180px;
  height: auto;
  margin: 0 auto var(--spacing-lg);
}

.login-title {
  font-size: 1.5rem;
  margin-bottom: var(--spacing-xs);
  color: var(--color-primary);
}

.login-subtitle {
  font-size: 1rem;
  color: var(--color-text-light);
  margin-bottom: var(--spacing-xl);
}

.login-help {
  margin-top: var(--spacing-lg);
  padding-top: var(--spacing-lg);
  border-top: 1px solid var(--color-border);
  font-size: 14px;
  color: var(--color-text-light);
}

.login-help a {
  color: var(--color-primary);
  font-weight: 600;
}

/* ==================
   INDEX PAGE (Accueil)
   ================== */
.index-page {
  min-height: 100vh;
  padding-bottom: var(--spacing-2xl);
}

.category-grid {
  margin-top: var(--spacing-xl);
}

.category-card {
  position: relative;
  height: 300px;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-base);
  background-size: cover;
  background-position: center;
}

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

.category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(27, 67, 50, 0.6) 0%, rgba(27, 67, 50, 0.9) 100%);
  transition: all var(--transition-base);
}

.category-card:hover::before {
  background: linear-gradient(to bottom, rgba(27, 67, 50, 0.7) 0%, rgba(27, 67, 50, 0.95) 100%);
}

.category-card-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-lg);
  color: white;
  text-align: center;
}

.category-icon {
  font-size: 3rem;
  margin-bottom: var(--spacing-md);
}

.category-title {
  font-size: 1.75rem;
  margin-bottom: var(--spacing-sm);
  color: white;
}

.category-status {
  margin-bottom: var(--spacing-md);
}

.category-progress {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: var(--spacing-lg);
}

.summary-section {
  margin-top: var(--spacing-2xl);
  padding: var(--spacing-xl);
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.summary-total {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--spacing-lg);
}

/* ==================
   CATEGORY PAGES
   ================== */
.category-page {
  min-height: 100vh;
  padding-bottom: var(--spacing-2xl);
}

.section {
  margin-bottom: var(--spacing-2xl);
}

.section-title {
  font-size: 1.5rem;
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 2px solid var(--color-primary);
}

.choice-container {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.product-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.product-info-item {
  display: flex;
  flex-direction: column;
}

.product-info-label {
  font-size: 14px;
  color: var(--color-text-light);
  margin-bottom: 4px;
}

.product-info-value {
  font-weight: 600;
  color: var(--color-text);
}

.pieces-list {
  list-style: none;
  margin-top: var(--spacing-sm);
}

.pieces-list li {
  padding: 4px 0;
  padding-left: var(--spacing-md);
  position: relative;
}

.pieces-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--color-primary);
  font-weight: bold;
}

.custom-choice-form {
  background: var(--color-bg);
  padding: var(--spacing-lg);
  border-radius: var(--radius-sm);
  margin-top: var(--spacing-md);
  border-left: 4px solid var(--color-primary);
}

.plus-value-display {
  background: white;
  padding: var(--spacing-lg);
  border-radius: var(--radius-sm);
  margin-top: var(--spacing-lg);
  text-align: center;
  border: 2px solid var(--color-border);
}

.plus-value-label {
  font-size: 14px;
  color: var(--color-text-light);
  margin-bottom: var(--spacing-xs);
}

.plus-value-amount {
  font-size: 2rem;
  font-weight: 700;
}

.plus-value-amount.positive {
  color: var(--color-success);
}

.plus-value-amount.negative {
  color: var(--color-error);
}

.plus-value-amount.neutral {
  color: var(--color-text-light);
}

.plus-value-detail {
  font-size: 14px;
  color: var(--color-text-light);
  margin-top: var(--spacing-xs);
}

.navigation-buttons {
  display: flex;
  justify-content: space-between;
  gap: var(--spacing-md);
  margin-top: var(--spacing-2xl);
  padding-top: var(--spacing-xl);
  border-top: 1px solid var(--color-border);
}

/* ==================
   ADMIN PAGE
   ================== */
.admin-page {
  min-height: 100vh;
  padding: var(--spacing-xl) 0;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-xl);
  flex-wrap: wrap;
  gap: var(--spacing-md);
}

.admin-actions {
  display: flex;
  gap: var(--spacing-md);
}

.project-row {
  cursor: pointer;
}

.project-name {
  font-weight: 600;
}

.project-client {
  font-size: 14px;
  color: var(--color-text-light);
}

.project-progression {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.project-progression-text {
  font-size: 14px;
  color: var(--color-text-light);
}

.mini-progress {
  width: 100%;
  height: 6px;
  background: var(--color-border);
  border-radius: 3px;
  overflow: hidden;
}

.mini-progress-fill {
  height: 100%;
  background: var(--color-success);
  border-radius: 3px;
  transition: width var(--transition-base);
}

/* ==================
   RESPONSIVE
   ================== */
@media (max-width: 768px) {
  .login-card {
    padding: var(--spacing-xl);
  }

  .category-card {
    height: 250px;
  }

  .category-icon {
    font-size: 2.5rem;
  }

  .category-title {
    font-size: 1.5rem;
  }

  .product-info {
    grid-template-columns: 1fr;
  }

  .navigation-buttons {
    flex-direction: column;
  }

  .navigation-buttons .btn {
    width: 100%;
  }

  .plus-value-amount {
    font-size: 1.5rem;
  }

  .admin-header {
    flex-direction: column;
    align-items: stretch;
  }

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

  /* Rendre le tableau responsive */
  .table-responsive {
    overflow-x: auto;
  }
}

/* ==================
   ADMIN CONFIG PAGE
   ================== */

.tabs-nav {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid #e0e0e0;
  margin-bottom: 32px;
}

.tab-btn {
  padding: 12px 24px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  color: #666;
  transition: all 0.3s ease;
}

.tab-btn:hover {
  color: var(--color-primary);
  background-color: #f5f5f5;
}

.tab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.tab-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.tab-header h2 {
  margin: 0;
  font-size: 1.75rem;
}

.info-box {
  background: #e3f2fd;
  border-left: 4px solid #2196f3;
  padding: 16px;
  margin-bottom: 24px;
  border-radius: 4px;
}

.info-box p {
  margin: 0;
  color: #1565c0;
}

/* Sortable List */
.sortable-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sortable-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 16px;
  transition: all 0.2s ease;
  cursor: move;
}

.sortable-item:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}

.drag-handle {
  font-size: 24px;
  color: #999;
  cursor: grab;
  user-select: none;
}

.drag-handle:active {
  cursor: grabbing;
}

.item-content {
  flex: 1;
}

.item-content h4 {
  margin: 0 0 4px 0;
  font-size: 1.1rem;
}

.item-content p {
  margin: 0;
  color: #666;
  font-size: 0.9rem;
}

.item-content small {
  color: #999;
  font-size: 0.85rem;
}

.item-actions {
  display: flex;
  gap: 8px;
}

/* Filter Section */
.filter-section {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.filter-section label {
  font-weight: 500;
  margin-bottom: 0;
}

.form-select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  min-width: 200px;
}

/* Table */
.table-responsive {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
}

.table thead {
  background: #f5f5f5;
}

.table th,
.table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
}

.table th {
  font-weight: 600;
  color: #333;
}

.table tbody tr:hover {
  background: #fafafa;
}

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

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 8px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
}

.modal-large {
  max-width: 1400px;
  width: 90%;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e0e0e0;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.5rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: #f5f5f5;
  color: #333;
}

.modal form {
  padding: 24px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #e0e0e0;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-row .form-group {
  margin-bottom: 0;
}

/* Toast */
#toastContainer {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: white;
  padding: 16px 20px;
  border-radius: 4px;
  box-shadow: var(--shadow-lg);
  min-width: 250px;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s ease;
  border-left: 4px solid #2196f3;
}

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

.toast-success {
  border-left-color: #4caf50;
  background: #f1f8f4;
  color: #2e7d32;
}

.toast-error {
  border-left-color: #f44336;
  background: #fef0f0;
  color: #c62828;
}

.toast-warning {
  border-left-color: #ff9800;
  background: #fff8e1;
  color: #e65100;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
  font-size: 1.1rem;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
}

.badge-success {
  background: #e8f5e9;
  color: #2e7d32;
}

.badge-secondary {
  background: #f5f5f5;
  color: #757575;
}

/* Admin Config Responsive */
@media (max-width: 768px) {
  .tabs-nav {
    overflow-x: auto;
  }

  .tab-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .modal-content {
    max-width: 100%;
  }

  .table {
    font-size: 0.9rem;
  }

  .table th,
  .table td {
    padding: 8px 12px;
  }

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

  #toastContainer {
    left: 20px;
    right: 20px;
  }

  .toast {
    min-width: auto;
  }
}
