/* ===== STYLE.CSS COMPLET - 3D PRINT DASHBOARD PRO 2026 ===== */
/* Glassmorphism compact + espacements optimisés + status dynamique */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: rgba(20, 20, 30, 0.8);
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.8);
  --accent: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  --shadow-hover: 0 30px 50px rgba(0, 0, 0, 0.35);
  --radius: 20px;
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.75rem;
  --spacing-lg: 2.5rem;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg-primary: #f8fafc;
    --bg-secondary: rgba(248, 250, 252, 0.9);
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(0, 0, 0, 0.05);
    --text-primary: #1e293b;
    --text-secondary: rgba(30, 41, 59, 0.8);
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  padding-top: var(--spacing-md);
}

/* ===== LAYOUT ===== */
.page-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ===== HEADER ===== */
header {
  text-align: center;
  margin-bottom: var(--spacing-lg);
  background: var(--glass-bg);
  backdrop-filter: blur(25px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow);
}

h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 700;
  background: var(--accent);
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.75rem;
}

header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* ===== FORMULAIRE ===== */
.form-container {
  background: var(--glass-bg);
  backdrop-filter: blur(25px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  max-width: 600px;
  margin: 0 auto 2.5rem;
}

form { display: grid; gap: 1.25rem; }

label {
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

input, textarea, select {
  width: 100%;
  padding: 0.875rem 1.125rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid var(--glass-border);
  border-radius: 14px;
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #667eea;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
  transform: translateY(-1px);
}

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

#status {
  padding: 1rem;
  border-radius: 14px;
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
  margin-top: 1.25rem;
}

#status.green { 
  background: rgba(17, 153, 142, 0.2); 
  border: 1px solid #38ef7d; 
  color: #11998e; 
}
#status.red { 
  background: rgba(255, 107, 107, 0.2); 
  border: 1px solid #ff6b6b; 
  color: #ff6b6b; 
}

/* ===== BOUTONS ===== */
button, .btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.875rem 1.75rem;
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
  min-height: 48px;
}

button:hover, .btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

/* ===== DASHBOARD ADMIN ===== */
.dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 2.5rem;
  margin-top: 3rem;
  padding: 0 1rem;
}

.dashboard > div { min-height: 600px; }

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-primary);
}

/* ===== CARDS REQUEST ===== */
.request, .card {
  background: var(--glass-bg);
  backdrop-filter: blur(30px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  height: 100%;
  display: flex;
  flex-direction: column;
  margin: 25px 0;
}

.request:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-hover);
}

.request-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.request-title {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.3;
  flex: 1;
}

.status-badge {
  padding: 0.5rem 1rem;
  border-radius: 25px;
  font-size: 0.85rem;
  font-weight: 700;
  min-width: fit-content;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* STATUS DYNAMIQUE */
.status-enattente, .status-en-attente { 
  background: rgba(255, 193, 7, 0.2) !important; 
  color: #ffc107 !important; 
  box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3) !important;
}
.status-fini { 
  background: rgba(40, 167, 69, 0.2) !important; 
  color: #28a745 !important; 
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3) !important;
}
.status-refuse, .status-refus { 
  background: rgba(220, 53, 69, 0.2) !important; 
  color: #dc3545 !important; 
  box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3) !important;
}

.request-details {
  flex: 1;
  margin-bottom: 1.75rem;
  color: var(--text-secondary);
}

.request-details p {
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.request-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.request-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--glass-border);
}

.download-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.5rem;
  background: rgba(102, 126, 234, 0.15);
  border: 1.5px solid rgba(102, 126, 234, 0.3);
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

.download-btn:hover {
  background: rgba(102, 126, 234, 0.3);
  transform: translateY(-2px);
}

.status-select {
  padding: 0.875rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1.5px solid var(--glass-border);
  border-radius: 14px;
  font-weight: 600;
  font-size: 0.95rem;
}

/* ===== ÉTATS VIDES ===== */
.empty, .error {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
  font-size: 1.1rem;
  border: 2px dashed var(--glass-border);
  border-radius: var(--radius);
  margin: 2rem 0;
}

.empty { border-color: rgba(102, 126, 234, 0.3); }
.error { color: #ff6b6b; border-color: rgba(255, 107, 107, 0.3); }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .page-wrapper { padding: 0 1.5rem; }
  #requests, #history {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }
  .dashboard {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 0;
  }
  .request, .card { padding: 1.75rem 1.5rem; }
}

@media (max-width: 480px) {
  .request-header { flex-direction: column; gap: 0.75rem; }
  .request-actions { gap: 0.875rem; }
  h1 { font-size: 1.875rem; }
}

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

.request, .form-container, header { animation: fadeInUp 0.4s ease-out; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
