/* ==========================================================================
   ROOTS BOTANICAL DESIGN SYSTEM - INDEX.CSS
   Tactile botanical aesthetic for Roots Attendance Tracker (by Gargee Sehgal)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,500;0,600;0,700;1,400&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* Background & Base Surfaces */
  --bg-app: #FAF7F2;
  --bg-surface: #FFFFFF;
  --bg-surface-elevated: #FDFCFA;
  --bg-subtle: #F4EFEA;
  --bg-card-border: #ECE3D8;
  
  /* Sage Green Palette (Primary / Nature / Success / Scan-In) */
  --sage-50: #F2F6F4;
  --sage-100: #E1EBE5;
  --sage-200: #C4D9CD;
  --sage-300: #9FBFAD;
  --sage-400: #769E89;
  --sage-500: #557E6B;
  --sage-600: #426756;
  --sage-700: #335043;
  --sage-800: #253C32;
  --sage-900: #1B2C24;

  /* Rose & Blush Palette (Accent / Floral / Warning / Scan-Out) */
  --rose-50: #FDF5F6;
  --rose-100: #FCE6E9;
  --rose-200: #F7CCD2;
  --rose-300: #EEA3AE;
  --rose-400: #E27284;
  --rose-500: #D24B62;
  --rose-600: #B7334A;
  --rose-700: #932437;

  /* Warm Ochre & Amber (Pending / Grace Period / Accents) */
  --amber-50: #FEF9EE;
  --amber-100: #FCF0D3;
  --amber-500: #D89835;
  --amber-700: #9C6718;

  /* Text & Contrast */
  --text-main: #24362D;
  --text-secondary: #577063;
  --text-muted: #839B8F;
  --text-light: #A4B7AD;
  --text-inverse: #FFFFFF;

  /* 3D Button Tactile Shadow Tokens */
  --btn-shadow-sage: 0 4px 0 #335043, 0 8px 16px rgba(51, 80, 67, 0.22);
  --btn-shadow-sage-pressed: 0 1px 0 #335043, 0 3px 6px rgba(51, 80, 67, 0.18);
  --btn-shadow-rose: 0 4px 0 #932437, 0 8px 16px rgba(183, 51, 74, 0.25);
  --btn-shadow-rose-pressed: 0 1px 0 #932437, 0 3px 6px rgba(183, 51, 74, 0.2);
  --btn-shadow-neutral: 0 4px 0 #D5C9BA, 0 6px 14px rgba(70, 50, 40, 0.08);
  --btn-shadow-neutral-pressed: 0 1px 0 #D5C9BA, 0 2px 4px rgba(70, 50, 40, 0.08);

  /* Elevation Shadows */
  --shadow-sm: 0 2px 6px rgba(36, 54, 45, 0.04);
  --shadow-md: 0 6px 18px rgba(36, 54, 45, 0.07);
  --shadow-lg: 0 14px 34px rgba(36, 54, 45, 0.1);
  --shadow-organic: 0 10px 30px -8px rgba(85, 126, 107, 0.15);

  /* Border Radii */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 9999px;

  /* Fonts */
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Botanical subtle background pattern */
body {
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(226, 235, 229, 0.6) 0%, transparent 40%),
    radial-gradient(circle at 90% 90%, rgba(252, 230, 233, 0.5) 0%, transparent 45%),
    radial-gradient(circle at 85% 15%, rgba(254, 249, 238, 0.7) 0%, transparent 35%);
  background-attachment: fixed;
  overflow-x: hidden;
}

#app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */

h1, h2, h3, .font-serif {
  font-family: var(--font-serif);
  color: var(--sage-900);
  font-weight: 600;
  letter-spacing: -0.01em;
}

h1 { font-size: 2rem; line-height: 1.25; }
h2 { font-size: 1.5rem; line-height: 1.3; }
h3 { font-size: 1.25rem; line-height: 1.35; }
p { color: var(--text-secondary); }

a {
  color: var(--sage-600);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--sage-800); }

/* ==========================================================================
   3D TACTILE BUTTONS
   ========================================================================== */

.btn-3d {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  transition: all var(--transition-fast);
  text-decoration: none;
  position: relative;
  outline: none;
}

/* Primary Sage 3D Button */
.btn-3d-sage {
  background: linear-gradient(180deg, #64907B 0%, #4D7461 100%);
  color: #FFFFFF;
  border-color: #426756;
  box-shadow: var(--btn-shadow-sage);
}
.btn-3d-sage:hover:not(:disabled) {
  background: linear-gradient(180deg, #6C9B85 0%, #547E6B 100%);
  transform: translateY(-1px);
  box-shadow: 0 5px 0 #335043, 0 10px 20px rgba(51, 80, 67, 0.25);
}
.btn-3d-sage:active:not(:disabled), .btn-3d-sage.pressed {
  transform: translateY(3px);
  box-shadow: var(--btn-shadow-sage-pressed);
}

/* Rose / Accent 3D Button */
.btn-3d-rose {
  background: linear-gradient(180deg, #E26477 0%, #C84156 100%);
  color: #FFFFFF;
  border-color: #B7334A;
  box-shadow: var(--btn-shadow-rose);
}
.btn-3d-rose:hover:not(:disabled) {
  background: linear-gradient(180deg, #EA7083 0%, #D44B60 100%);
  transform: translateY(-1px);
  box-shadow: 0 5px 0 #932437, 0 10px 20px rgba(183, 51, 74, 0.28);
}
.btn-3d-rose:active:not(:disabled), .btn-3d-rose.pressed {
  transform: translateY(3px);
  box-shadow: var(--btn-shadow-rose-pressed);
}

/* Neutral / Secondary 3D Button */
.btn-3d-secondary {
  background: linear-gradient(180deg, #FFFFFF 0%, #F5EEE4 100%);
  color: var(--text-main);
  border: 1px solid var(--bg-card-border);
  box-shadow: var(--btn-shadow-neutral);
}
.btn-3d-secondary:hover:not(:disabled) {
  background: linear-gradient(180deg, #FFFFFF 0%, #EDE4D8 100%);
  transform: translateY(-1px);
  box-shadow: 0 5px 0 #D5C9BA, 0 8px 18px rgba(70, 50, 40, 0.1);
}
.btn-3d-secondary:active:not(:disabled), .btn-3d-secondary.pressed {
  transform: translateY(3px);
  box-shadow: var(--btn-shadow-neutral-pressed);
}

/* Ghost / Soft Button */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-ghost:hover {
  background: var(--sage-100);
  color: var(--sage-800);
}

.btn-3d:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1.1rem;
  border-radius: var(--radius-lg);
}

/* ==========================================================================
   CARDS & ORGANIC SURFACES
   ========================================================================== */

.card-floral {
  background: var(--bg-surface);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}
.card-floral:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--sage-200);
}

.card-subtle {
  background: var(--bg-subtle);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 16px;
}

/* Floral botanical corner badge accent */
.floral-accent-top-right {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 44px;
  height: 44px;
  opacity: 0.35;
  pointer-events: none;
}

/* ==========================================================================
   BADGES & PILLS
   ========================================================================== */

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.badge-present {
  background: var(--sage-100);
  color: var(--sage-700);
  border: 1px solid var(--sage-300);
}

.badge-late {
  background: var(--amber-100);
  color: var(--amber-700);
  border: 1px solid #E8CD90;
}

.badge-absent {
  background: var(--rose-100);
  color: var(--rose-700);
  border: 1px solid var(--rose-300);
}

.badge-shift {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--bg-card-border);
}

.badge-overtime {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FCD34D;
}

.badge-deduction {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FCA5A5;
}

.badge-neutral {
  background: #F3F4F6;
  color: #4B5563;
  border: 1px solid #E5E7EB;
}

/* Preset buttons for grace period and multipliers */
.btn-preset {
  padding: 4px 10px;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: var(--radius-xs);
  border: 1px solid var(--bg-card-border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-preset:hover {
  background: var(--sage-100);
  border-color: var(--sage-400);
  color: var(--sage-900);
}
.btn-preset.active {
  background: var(--sage-600);
  color: #FFFFFF;
  border-color: var(--sage-700);
}

/* Toggle Switch */
.switch-floral {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.switch-floral input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #D1D5DB;
  transition: .25s;
  border-radius: 24px;
}
.switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .25s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
input:checked + .switch-slider {
  background-color: var(--sage-600);
}
input:checked + .switch-slider:before {
  transform: translateX(20px);
}

/* ==========================================================================
   INPUTS & FORM CONTROLS
   ========================================================================== */

.form-group {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

.input-floral {
  width: 100%;
  padding: 11px 14px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  background-color: var(--bg-surface);
  color: var(--text-main);
  border: 1.5px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: all var(--transition-fast);
}

.input-floral:focus {
  border-color: var(--sage-500);
  box-shadow: 0 0 0 3px rgba(85, 126, 107, 0.15);
  background-color: #FFFFFF;
}

.input-floral::placeholder {
  color: var(--text-light);
}

select.input-floral {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23577063' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* ==========================================================================
   MODAL DIALOGS
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(36, 54, 45, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

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

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 30px;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.96);
  transition: transform var(--transition-normal);
  position: relative;
}

.modal-backdrop.active .modal-dialog {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--bg-card-border);
}

.modal-close-btn {
  background: var(--bg-subtle);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.modal-close-btn:hover {
  background: var(--rose-100);
  color: var(--rose-700);
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */

#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.92rem;
  font-weight: 500;
  pointer-events: auto;
  animation: slideInToast 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  max-width: 360px;
}

.toast.toast-success {
  border-left: 5px solid var(--sage-500);
}
.toast.toast-error {
  border-left: 5px solid var(--rose-500);
}
.toast.toast-info {
  border-left: 5px solid var(--amber-500);
}

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

/* ==========================================================================
   BLOOMING & PETAL ANIMATIONS
   ========================================================================== */

@keyframes pulseBloom {
  0% {
    box-shadow: 0 0 0 0 rgba(85, 126, 107, 0.4);
  }
  70% {
    box-shadow: 0 0 0 24px rgba(85, 126, 107, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(85, 126, 107, 0);
  }
}

@keyframes pulseRoseBloom {
  0% {
    box-shadow: 0 0 0 0 rgba(210, 75, 98, 0.4);
  }
  70% {
    box-shadow: 0 0 0 24px rgba(210, 75, 98, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(210, 75, 98, 0);
  }
}

@keyframes floatGentle {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-6px) rotate(2deg); }
}

.animated-float {
  animation: floatGentle 4s ease-in-out infinite;
}

/* Sync indicator */
.sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  padding: 4px 11px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--bg-card-border);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}
.sync-badge:hover {
  background: var(--sage-50);
  border-color: var(--sage-300);
  color: var(--sage-900);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--sage-500);
  transition: all 0.2s ease;
}
.sync-dot.syncing {
  background: var(--amber-500);
  animation: pulseSync 0.8s infinite alternate;
}
.sync-dot.sync-live {
  background: #2E7D32;
  box-shadow: 0 0 6px rgba(46, 125, 50, 0.5);
}
.sync-dot.sync-pending {
  background: #E65100;
  animation: pulseSync 1s infinite alternate;
}
.sync-dot.sync-local {
  background: var(--sage-400);
}
@keyframes pulseSync {
  from { opacity: 0.4; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1.2); }
}

/* Loading spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive utilities */
@media (max-width: 640px) {
  #toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }
  .modal-dialog {
    padding: 20px;
  }
}
