/* ==========================================================================
   Cinderella Checklist System - Main Stylesheet
   ========================================================================== */

:root {
  --primary: #e91e63;
  --primary-dark: #ad1457;
  --primary-light: #f8bbd0;
  --primary-bg: #fce4ec;
  --secondary: #6c757d;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --dark: #1f2937;
  --light: #f8f9fa;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);
  --shadow-pink: 0 8px 25px rgba(233, 30, 99, 0.25);
}

* { box-sizing: border-box; }

body {
  font-family: 'Tajawal', 'Cairo', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  min-height: 100vh;
  margin: 0;
  font-size: 15px;
}

/* ===== Layout ===== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  width: 260px;
  background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #fff;
  padding: 0;
  box-shadow: var(--shadow-lg);
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  right: 0;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.sidebar-logo {
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 24px;
  font-weight: 700;
}

.sidebar-brand {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
}

.sidebar-subtitle {
  font-size: 12px;
  opacity: 0.8;
  margin: 4px 0 0;
}

.sidebar-nav {
  padding: 16px 0;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition: all 0.2s;
  position: relative;
  font-size: 14px;
  font-weight: 500;
}

.sidebar-nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.sidebar-nav-item.active {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-right: 3px solid #fff;
}

.sidebar-nav-item i {
  font-size: 18px;
  width: 24px;
}

.sidebar-nav-divider {
  margin: 12px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11px;
  text-transform: uppercase;
  padding-top: 12px;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 1px;
}

.app-main {
  flex: 1;
  margin-right: 260px;
  display: flex;
  flex-direction: column;
}

.app-topbar {
  background: #fff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title { font-size: 20px; font-weight: 700; color: var(--gray-800); margin: 0; }

.topbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name { font-weight: 600; font-size: 14px; color: var(--gray-800); }
.user-role { font-size: 12px; color: var(--gray-500); }

.app-content {
  padding: 24px;
  flex: 1;
}

/* ===== Cards ===== */
.card-modern {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-100);
  margin-bottom: 20px;
}

.card-modern-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-modern-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  color: var(--gray-800);
}

/* ===== Stat Cards ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-100);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
}

.stat-card.success::before { background: var(--success); }
.stat-card.warning::before { background: var(--warning); }
.stat-card.danger::before  { background: var(--danger); }
.stat-card.info::before    { background: var(--info); }

.stat-card-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: var(--primary-bg);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
}

.stat-card.success .stat-card-icon { background: #d1fae5; color: var(--success); }
.stat-card.warning .stat-card-icon { background: #fef3c7; color: var(--warning); }
.stat-card.danger .stat-card-icon  { background: #fee2e2; color: var(--danger); }
.stat-card.info .stat-card-icon    { background: #dbeafe; color: var(--info); }

.stat-card-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--gray-800);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-card-label {
  font-size: 13px;
  color: var(--gray-500);
  font-weight: 500;
}

.stat-card-change {
  font-size: 12px;
  margin-top: 8px;
}
.stat-card-change.up { color: var(--success); }
.stat-card-change.down { color: var(--danger); }

/* ===== Buttons ===== */
.btn-primary-cinder {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary-cinder:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-pink);
  color: #fff;
}

/* ===== Forms ===== */
.form-modern label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-modern input,
.form-modern select,
.form-modern textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: all 0.2s;
  background: #fff;
}

.form-modern input:focus,
.form-modern select:focus,
.form-modern textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.1);
}

/* ===== Tables ===== */
.table-modern {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.table-modern thead th {
  background: var(--gray-50);
  padding: 14px;
  font-weight: 700;
  font-size: 13px;
  color: var(--gray-700);
  text-align: right;
  border-bottom: 1px solid var(--gray-200);
}

.table-modern tbody td {
  padding: 14px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 14px;
}

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

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

/* ===== Badges ===== */
.badge-soft {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.badge-soft.success { background: #d1fae5; color: #065f46; }
.badge-soft.warning { background: #fef3c7; color: #92400e; }
.badge-soft.danger  { background: #fee2e2; color: #991b1b; }
.badge-soft.info    { background: #dbeafe; color: #1e40af; }
.badge-soft.gray    { background: var(--gray-100); color: var(--gray-700); }
.badge-soft.primary { background: var(--primary-bg); color: var(--primary-dark); }

/* ===== Checklist Wizard ===== */
.wizard-container {
  max-width: 900px;
  margin: 0 auto;
}

.wizard-steps {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  padding: 20px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  overflow-x: auto;
}

.wizard-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  min-width: 100px;
  text-align: center;
}

.wizard-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 22px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: var(--gray-200);
  z-index: 0;
}

.wizard-step.completed:not(:last-child)::after {
  background: var(--success);
}

.wizard-step-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--gray-400);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  position: relative;
  z-index: 1;
  margin-bottom: 8px;
  transition: all 0.3s;
}

.wizard-step.active .wizard-step-icon {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: var(--shadow-pink);
  transform: scale(1.1);
}

.wizard-step.completed .wizard-step-icon {
  background: var(--success);
  color: #fff;
}

.wizard-step-label {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 600;
}

.wizard-step.active .wizard-step-label,
.wizard-step.completed .wizard-step-label {
  color: var(--gray-800);
}

.wizard-content {
  background: #fff;
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  min-height: 400px;
  animation: fadeIn 0.3s;
}

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

.wizard-content h3 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--gray-800);
}

.wizard-content .step-description {
  color: var(--gray-500);
  margin-bottom: 24px;
}

/* ===== Question Item ===== */
.question-item {
  background: var(--gray-50);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--gray-200);
  transition: all 0.2s;
}

.question-item.answered {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.question-item.failed {
  background: #fef2f2;
  border-color: #fecaca;
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 12px;
  gap: 12px;
}

.question-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-800);
  margin: 0;
  flex: 1;
}

.question-required {
  color: var(--danger);
  font-weight: 700;
  margin-right: 4px;
}

.question-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.answer-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.answer-btn {
  padding: 8px 16px;
  border: 2px solid var(--gray-300);
  background: #fff;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s;
}

.answer-btn:hover {
  border-color: var(--primary);
}

.answer-btn.selected.yes {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.answer-btn.selected.no {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.rating-group {
  display: flex;
  gap: 6px;
  align-items: center;
}

.rating-star {
  width: 36px;
  height: 36px;
  border: 2px solid var(--gray-300);
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rating-star:hover,
.rating-star.selected {
  background: var(--warning);
  border-color: var(--warning);
  color: #fff;
  transform: scale(1.05);
}

.image-upload-box {
  margin-top: 12px;
  padding: 16px;
  background: #fff;
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-sm);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.image-upload-box:hover {
  border-color: var(--primary);
  background: var(--primary-bg);
}

.image-upload-box.has-image {
  border-style: solid;
  border-color: var(--success);
  background: #f0fdf4;
  padding: 8px;
}

.image-upload-box img {
  max-width: 100%;
  max-height: 200px;
  border-radius: var(--radius-sm);
}

.image-upload-box input[type="file"] {
  display: none;
}

.image-upload-required {
  font-size: 12px;
  color: var(--danger);
  margin-top: 6px;
  font-weight: 600;
}

/* ===== Wizard Navigation ===== */
.wizard-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--gray-200);
}

.wizard-progress {
  background: var(--gray-100);
  border-radius: 100px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 24px;
}

.wizard-progress-bar {
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  height: 100%;
  transition: width 0.4s;
  border-radius: 100px;
}

/* ===== Login Page ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e91e63 0%, #ad1457 50%, #4a0e2a 100%);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  top: -200px;
  right: -200px;
}

.login-page::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  bottom: -150px;
  left: -150px;
}

.login-card {
  background: #fff;
  border-radius: 24px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1;
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 36px;
  box-shadow: var(--shadow-pink);
}

.login-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--gray-800);
  margin: 0 0 4px;
}

.login-subtitle {
  color: var(--gray-500);
  font-size: 14px;
}

.login-form .form-group {
  margin-bottom: 18px;
}

.login-form input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 15px;
  transition: all 0.2s;
}

.login-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.1);
}

.login-btn {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-pink);
}

/* ===== Report ===== */
.report-grade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  font-size: 32px;
  font-weight: 700;
  color: #fff;
}

.report-section {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.report-section h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-800);
  margin: 0 0 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-100);
}

/* ===== Mobile Menu Toggle ===== */
.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--primary);
  cursor: pointer;
}

/* ===== Responsive ===== */
@media (max-width: 992px) {
  .app-sidebar {
    transform: translateX(100%);
  }
  .app-sidebar.show {
    transform: translateX(0);
  }
  .app-main {
    margin-right: 0;
  }
  .mobile-menu-btn {
    display: block;
  }
}

/* ===== Utility ===== */
.text-primary-cinder { color: var(--primary) !important; }
.bg-primary-cinder { background: var(--primary) !important; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-400);
}

.empty-state i {
  font-size: 64px;
  margin-bottom: 16px;
}

.empty-state p {
  font-size: 16px;
  margin: 0;
}

.alert-soft {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 14px;
}
.alert-soft.success { background: #d1fae5; color: #065f46; border-right: 3px solid var(--success); }
.alert-soft.danger  { background: #fee2e2; color: #991b1b; border-right: 3px solid var(--danger); }
.alert-soft.warning { background: #fef3c7; color: #92400e; border-right: 3px solid var(--warning); }
.alert-soft.info    { background: #dbeafe; color: #1e40af; border-right: 3px solid var(--info); }

/* ===== Animations ===== */
.spin {
  animation: spin 1s linear infinite;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.fade-in { animation: fadeIn 0.3s; }
