@import "tailwindcss";

/* ===================================
e   Heartily - Design System
   "Whatever you do, work heartily, as for the Lord" - Col 3:23
   Aesthetic: Refined Academic / Premium Productivity
   =================================== */

/* Custom Fonts - Import distinctive typefaces */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300..900;1,9..144,300..900&family=Source+Sans+3:ital,wght@0,300..900;1,300..900&display=swap');

:root {
  /* Warm academic color palette */
  --ink: #1a1612;
  --ink-muted: #4a453f;
  --ink-light: #7a756f;
  --paper: #faf8f5;
  --paper-warm: #f5f2ed;
  --cream: #ebe6dd;
  --gold: #b8860b;
  --gold-light: #daa520;

  /* Semantic colors with warmth */
  --urgent: #c23b22;
  --urgent-bg: #fef2f0;
  --warning: #d4820a;
  --warning-bg: #fef8eb;
  --calm: #2563eb;
  --calm-bg: #eff4ff;
  --success: #16803c;
  --success-bg: #eefbf3;

  /* Course accent colors */
  --course-1: #7c3aed;
  --course-2: #0891b2;
  --course-3: #c026d3;
  --course-4: #ea580c;
  --course-5: #059669;
  --course-6: #dc2626;
}

/* Base typography */
body {
  font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* Display typography */
.font-display {
  font-family: 'Fraunces', Georgia, serif;
  font-optical-sizing: auto;
}

/* Hide scrollbar for course filter */
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

/* Subtle hover lift effect */
.hover-lift {
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -8px rgba(26, 22, 18, 0.15);
}

/* Course tab active indicator */
.course-tab {
  position: relative;
  transition: all 200ms ease;
}

.course-tab::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px;
  height: 60%;
  border-radius: 0 2px 2px 0;
  background: currentColor;
  transition: transform 200ms ease;
}

.course-tab.active::before,
.course-tab:hover::before {
  transform: translateY(-50%) scaleY(1);
}

/* Stats card with gradient border */
.stat-card {
  position: relative;
  background: white;
  border-radius: 16px;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 2px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent-color, #e5e5e5), transparent);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
  opacity: 0.6;
  transition: opacity 200ms ease;
}

.stat-card:hover::before {
  opacity: 1;
}

/* Assignment card urgency stripe */
.assignment-card {
  position: relative;
  background: white;
  border-radius: 12px;
  overflow: hidden;
}

.assignment-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--urgency-color, var(--cream));
}

/* Staggered animation for lists */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stagger-in {
  animation: slideIn 300ms ease forwards;
  opacity: 0;
}

.stagger-in:nth-child(1) { animation-delay: 0ms; }
.stagger-in:nth-child(2) { animation-delay: 50ms; }
.stagger-in:nth-child(3) { animation-delay: 100ms; }
.stagger-in:nth-child(4) { animation-delay: 150ms; }
.stagger-in:nth-child(5) { animation-delay: 200ms; }
.stagger-in:nth-child(6) { animation-delay: 250ms; }
.stagger-in:nth-child(7) { animation-delay: 300ms; }
.stagger-in:nth-child(8) { animation-delay: 350ms; }

/* Pulse animation for overdue count */
@keyframes pulse-urgent {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.pulse-urgent {
  animation: pulse-urgent 2s ease-in-out infinite;
}

/* Section divider with subtle gradient */
.section-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--cream), transparent);
  margin: 1.5rem 0;
}

/* Checkbox completion animation */
@keyframes check-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.check-complete {
  animation: check-pop 300ms ease;
}

/* Badge styles */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.badge-missing {
  background: var(--urgent-bg);
  color: var(--urgent);
}

.badge-late {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-submitted {
  background: var(--success-bg);
  color: var(--success);
}

/* Smooth transitions - more refined than blanket rule */
.transition-colors-smooth {
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

.transition-transform-smooth {
  transition: transform 200ms ease;
}

.transition-opacity-smooth {
  transition: opacity 200ms ease;
}

/* Completed assignment cross-out with elegance */
.completed-line {
  position: relative;
}

.completed-line::after {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 1.5px;
  background: var(--ink-light);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 300ms ease;
}

.completed-line.is-completed::after {
  transform: scaleX(1);
}

/* Course color indicators */
.course-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Empty state illustration styling */
.empty-state-icon {
  opacity: 0.4;
  filter: grayscale(0.3);
}

/* Subtle paper texture overlay */
.paper-texture {
  position: relative;
}

.paper-texture::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.02;
  pointer-events: none;
  mix-blend-mode: multiply;
}

/* Safe area insets for iOS devices */
.safe-area-inset-bottom {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Mobile-specific optimizations */
@media (max-width: 1023px) {
  /* Ensure tap targets are at least 44px for accessibility */
  .course-tab,
  .stat-card,
  .assignment-card {
    min-height: 44px;
  }

  /* Optimize touch scrolling */
  .overflow-y-auto {
    -webkit-overflow-scrolling: touch;
  }
}

/* ===================================
   Marketing Page Animations
   =================================== */

/* Shimmer gradient animation for hero text */
@keyframes shimmer {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

.text-shimmer {
  background: linear-gradient(
    90deg,
    var(--gold) 0%,
    #daa520 25%,
    #f4c430 50%,
    #daa520 75%,
    var(--gold) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 3s ease-in-out infinite;
}

/* Floating animation for decorative elements */
@keyframes float {
  0%, 100% {
    transform: translateY(0) rotate(var(--rotate, 0deg));
  }
  50% {
    transform: translateY(-20px) rotate(var(--rotate, 0deg));
  }
}

@keyframes float-delayed {
  0%, 100% {
    transform: translateY(0) rotate(var(--rotate, 0deg));
  }
  50% {
    transform: translateY(-15px) rotate(var(--rotate, 0deg));
  }
}

.float {
  animation: float 6s ease-in-out infinite;
}

.float-delayed {
  animation: float-delayed 7s ease-in-out infinite;
  animation-delay: -2s;
}

.float-slow {
  animation: float 8s ease-in-out infinite;
  animation-delay: -4s;
}

/* Hero entrance animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.hero-animate {
  opacity: 0;
  animation: fadeInUp 0.8s ease forwards;
}

.hero-animate-delay-1 {
  animation-delay: 0.1s;
}

.hero-animate-delay-2 {
  animation-delay: 0.2s;
}

.hero-animate-delay-3 {
  animation-delay: 0.3s;
}

.hero-animate-delay-4 {
  animation-delay: 0.4s;
}

.hero-animate-delay-5 {
  animation-delay: 0.5s;
}

/* Glowing CTA button */
@keyframes glow-pulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(26, 22, 18, 0.3), 0 10px 40px -10px rgba(26, 22, 18, 0.4);
  }
  50% {
    box-shadow: 0 0 30px rgba(26, 22, 18, 0.4), 0 15px 50px -10px rgba(26, 22, 18, 0.5);
  }
}

.btn-glow {
  animation: glow-pulse 2s ease-in-out infinite;
}

/* Dashboard preview float and tilt */
@keyframes dashboard-float {
  0%, 100% {
    transform: perspective(1000px) rotateX(2deg) rotateY(-1deg) translateY(0);
  }
  50% {
    transform: perspective(1000px) rotateX(2deg) rotateY(-1deg) translateY(-10px);
  }
}

.dashboard-preview {
  animation: dashboard-float 6s ease-in-out infinite;
  transform-style: preserve-3d;
}

/* Badge bounce animation */
@keyframes badge-bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

.badge-animated {
  animation: badge-bounce 2s ease-in-out infinite;
}
