/* GCSE Revision Tracker - Core Styles */

/* Reset and base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* Focus styles for accessibility */
*:focus-visible {
  outline: 2px solid #4F46E5;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Transition defaults */
.transition-smooth { transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); }

/* Topic card grid - matching Natasha's visual design */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

@media (min-width: 640px) {
  .topic-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
}

@media (min-width: 1024px) {
  .topic-grid { grid-template-columns: repeat(5, 1fr); gap: 16px; }
}

/* Topic card - inspired by the blush pink rounded cards */
.topic-card {
  border-radius: 16px;
  padding: 16px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.topic-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px -5px rgba(0,0,0,0.1);
}

.topic-card:active {
  transform: translateY(0);
}

/* Confidence indicators */
.confidence-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.confidence-1 { background-color: #EF4444; }
.confidence-2 { background-color: #F97316; }
.confidence-3 { background-color: #EAB308; }
.confidence-4 { background-color: #22C55E; }
.confidence-5 { background-color: #10B981; }

/* Status badges */
.status-badge {
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 9999px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Subject header pill - matching the dark rounded pill from the tracker */
.subject-pill {
  background: #1e1e2e;
  color: white;
  padding: 10px 28px;
  border-radius: 9999px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: inline-block;
  font-size: 0.85rem;
}

/* Navigation */
.nav-item {
  padding: 8px 16px;
  border-radius: 10px;
  transition: all 0.15s ease;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
}

.nav-item:hover { background: #f1f5f9; }
.nav-item.active { background: #e0e7ff; color: #4338ca; font-weight: 600; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-content {
  background: white;
  border-radius: 20px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}

/* Quick log form */
.quick-log-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #4F46E5;
  color: white;
  border: none;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.quick-log-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.5);
}

@media (min-width: 768px) {
  .quick-log-btn { bottom: 32px; right: 32px; width: 64px; height: 64px; }
}

/* Bottom nav for mobile */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid #e5e7eb;
  padding: 4px 0 env(safe-area-inset-bottom, 8px);
  z-index: 30;
  display: flex;
  justify-content: space-around;
}

@media (min-width: 768px) {
  .bottom-nav { display: none; }
}

/* Print styles */
@media print {
  .no-print { display: none !important; }
  .print-only { display: block !important; }
  body { background: white; font-size: 11pt; }
  .topic-card { break-inside: avoid; border: 1px solid #ddd; box-shadow: none; }
  .topic-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
}

.print-only { display: none; }

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

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

.animate-fade-in { animation: fadeIn 0.3s ease forwards; }
.animate-slide-up { animation: slideUp 0.4s ease forwards; }

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Ensure content doesn't hide behind bottom nav on mobile */
@media (max-width: 767px) {
  #app { padding-bottom: 80px; }
}

/* Tab underline style */
.tab-active {
  border-bottom: 2px solid #4F46E5;
  color: #4338CA;
  font-weight: 600;
}
