/* ===== DEVENTRIC BLOOD BANK - GLOBAL STYLES ===== */

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

/* ===== CSS VARIABLES ===== */
:root {
  --red-primary: #E8203A;
  --red-dark: #B5001F;
  --red-light: #FF4D6D;
  --red-soft: #FFF0F2;
  --crimson: #C0152A;

  --black: #0A0A0A;
  --dark: #111827;
  --dark-card: #1a2230;
  --gray-900: #1F2937;
  --gray-800: #374151;
  --gray-600: #4B5563;
  --gray-400: #9CA3AF;
  --gray-200: #E5E7EB;
  --gray-100: #F3F4F6;
  --white: #FFFFFF;

  --gradient-red: linear-gradient(135deg, #E8203A 0%, #FF6B35 100%);
  --gradient-dark: linear-gradient(135deg, #0A0A0A 0%, #1a1a2e 100%);
  --gradient-hero: linear-gradient(135deg, #0A0A0A 0%, #1a0a0f 50%, #2d0a14 100%);

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.15);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.2);
  --shadow-red: 0 4px 20px rgba(232,32,58,0.3);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 32px;
  --radius-full: 9999px;

  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;

  --transition: all 0.25s ease;
  --transition-slow: all 0.4s ease;
}

/* ===== RESET ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--white);
  color: var(--gray-900);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font-body);
}

input, select, textarea {
  font-family: var(--font-body);
  outline: none;
}

/* ===== UTILITY CLASSES ===== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.section-padding {
  padding: 80px 0;
}

.text-center { text-align: center; }
.text-red { color: var(--red-primary); }
.text-white { color: var(--white); }
.text-gray { color: var(--gray-600); }

.hidden { display: none !important; }

/* ===== BADGE / TAGS ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
}

.badge-critical {
  background: #FEE2E2;
  color: #991B1B;
}

.badge-normal {
  background: #D1FAE5;
  color: #065F46;
}

.badge-open {
  background: #DBEAFE;
  color: #1E40AF;
}

.badge-completed {
  background: var(--gray-200);
  color: var(--gray-600);
}

.badge-verified {
  background: linear-gradient(135deg, #E8203A, #FF6B35);
  color: white;
}

.badge-available {
  background: #D1FAE5;
  color: #065F46;
}

.badge-busy {
  background: #FEF3C7;
  color: #92400E;
}

/* ===== BLOOD GROUP BADGE ===== */
.blood-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--gradient-red);
  color: white;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
  box-shadow: var(--shadow-red);
}

.blood-badge-sm {
  width: 38px;
  height: 38px;
  font-size: 12px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
  cursor: pointer;
}

.btn-primary {
  background: var(--gradient-red);
  color: white;
  box-shadow: var(--shadow-red);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(232,32,58,0.45);
}

.btn-outline {
  background: transparent;
  color: var(--red-primary);
  border: 2px solid var(--red-primary);
}

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

.btn-white {
  background: white;
  color: var(--red-primary);
  box-shadow: var(--shadow-md);
}

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

.btn-ghost {
  background: rgba(255,255,255,0.1);
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
}

.btn-ghost:hover {
  background: rgba(255,255,255,0.2);
}

.btn-sm {
  padding: 8px 18px;
  font-size: 13px;
}

.btn-lg {
  padding: 16px 36px;
  font-size: 17px;
}

/* ===== SECTION HEADINGS ===== */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--red-primary);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.section-label::before {
  content: '';
  width: 24px;
  height: 2px;
  background: var(--gradient-red);
  border-radius: 2px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 36px;
  font-weight: 800;
  color: var(--dark);
  line-height: 1.2;
  margin-bottom: 16px;
}

.section-title span {
  background: var(--gradient-red);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-desc {
  font-size: 17px;
  color: var(--gray-600);
  max-width: 560px;
  line-height: 1.7;
}

/* ===== FORM ELEMENTS ===== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.form-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-800);
}

.form-input, .form-select, .form-textarea {
  padding: 12px 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 15px;
  color: var(--gray-900);
  background: white;
  transition: var(--transition);
  width: 100%;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--red-primary);
  box-shadow: 0 0 0 3px rgba(232,32,58,0.1);
}

.form-input::placeholder {
  color: var(--gray-400);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

/* ===== CARDS ===== */
.card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  overflow: hidden;
}

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

.card-body {
  padding: 24px;
}

/* ===== DIVIDER ===== */
.divider {
  width: 60px;
  height: 4px;
  background: var(--gradient-red);
  border-radius: var(--radius-full);
  margin: 16px 0;
}

.divider-center {
  margin: 16px auto;
}

/* ===== MODAL OVERLAY ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  background: white;
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: var(--transition);
}

.modal-overlay.active .modal-box {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  color: var(--gray-600);
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--gray-200);
}

/* ===== ALERT BANNER ===== */
.alert {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
}

.alert-danger {
  background: #FEE2E2;
  color: #991B1B;
  border-left: 4px solid var(--red-primary);
}

.alert-info {
  background: #DBEAFE;
  color: #1E40AF;
  border-left: 4px solid #3B82F6;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
  background: var(--red-primary);
  border-radius: 3px;
}

/* ===== PULSE ANIMATION ===== */
@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232,32,58,0.4); }
  50% { box-shadow: 0 0 0 12px rgba(232,32,58,0); }
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.pulse { animation: pulse-red 2s infinite; }
.fade-in { animation: fadeIn 0.5s ease forwards; }
.fade-in-up { animation: fadeInUp 0.6s ease forwards; }

/* ===== RESPONSIVE HELPERS ===== */
@media (max-width: 768px) {
  .section-padding {
    padding: 56px 0;
  }

  .section-title {
    font-size: 26px;
  }

  .section-desc {
    font-size: 15px;
  }

  .btn-lg {
    padding: 14px 28px;
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .section-title {
    font-size: 22px;
  }
}

/* ===== TOAST NOTIFICATIONS (used by js/main.js showToast) ===== */
#toastContainer {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  animation: fadeInUp 0.3s ease;
  min-width: 260px;
  max-width: 340px;
}

.toast-success { background: #065F46; color: white; }
.toast-error   { background: #991B1B; color: white; }
.toast-info    { background: #1E40AF; color: white; }

@media (max-width: 480px) {
  #toastContainer {
    bottom: 16px;
    right: 16px;
    left: 16px;
  }
  .toast { min-width: unset; width: 100%; }
}

/* ===== SELECT DROPDOWN — unique theme gradient styling ===== */

.form-select,
select {
  /* Gradient background using theme colours (red → orange) */
  background-image: linear-gradient(135deg, #E8203A 0%, #c0152a 60%, #FF6B35 100%),
                    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23ffffff' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-position: 0 0, calc(100% - 14px) center;
  background-size: 100% 100%, 12px 8px;
  background-color: #E8203A !important;
  color: #ffffff !important;
  font-weight: 600;
  border: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  padding-right: 40px !important;
  cursor: pointer;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
  box-shadow: 0 4px 15px rgba(232,32,58,0.35) !important;
  letter-spacing: 0.3px;
}

.form-select:focus,
select:focus {
  box-shadow: 0 0 0 3px rgba(232,32,58,0.3), 0 4px 15px rgba(232,32,58,0.4) !important;
  outline: none;
}

.form-select:hover,
select:hover {
  background-image: linear-gradient(135deg, #c0152a 0%, #E8203A 50%, #e05a28 100%),
                    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23ffffff' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-position: 0 0, calc(100% - 14px) center;
  background-size: 100% 100%, 12px 8px;
  box-shadow: 0 6px 20px rgba(232,32,58,0.5) !important;
}

/* Placeholder / first option */
.form-select option:first-child,
select option:first-child {
  color: rgba(255,255,255,0.75);
  font-style: italic;
}

/* All option items */
.form-select option,
select option {
  background-color: #1a0a0f;
  color: #ffffff;
  font-weight: 500;
  font-size: 14px;
  padding: 10px 14px;
}

.form-select option:hover,
select option:hover,
.form-select option:checked,
select option:checked {
  background-color: #E8203A;
  color: #ffffff;
}

/* ===== BLOOD GROUP BUBBLE PICKER ===== */
/* Replaces native <select> for blood group on all pages */

.bg-bubble-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.bg-bubble {
  padding: 8px 14px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 800;
  color: var(--gray-600);
  background: white;
  cursor: pointer;
  transition: all 0.18s ease;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.bg-bubble:hover {
  border-color: var(--red-primary);
  color: var(--red-primary);
  transform: translateY(-1px);
}

.bg-bubble.active {
  background: linear-gradient(135deg, #E8203A 0%, #c0152a 55%, #FF6B35 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(232,32,58,0.4);
  transform: translateY(-1px);
}

.bg-bubble.active:hover {
  box-shadow: 0 6px 16px rgba(232,32,58,0.55);
}

/* Slightly smaller variant for tight spaces (modals) */
.bg-bubble-picker.sm .bg-bubble {
  padding: 6px 11px;
  font-size: 12px;
}

@media (max-width: 480px) {
  .bg-bubble {
    padding: 7px 11px;
    font-size: 12px;
  }
}