/* Modern Design System - Clean, Calm, Organized */

/* Spacing System */
:root {
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.15);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.2);
  --shadow-xl: 0 12px 32px rgba(0,0,0,0.25);
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
  --transition-slow: 0.3s ease;
}

/* Modern Card System */
.modern-card {
  background: rgba(15,23,42,0.95);
  border: 1px solid rgba(148,163,184,0.2);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  transition: all var(--transition-base);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modern-card:hover {
  border-color: rgba(148,163,184,0.35);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

body.light .modern-card {
  background: rgba(255,255,255,0.98);
  border-color: rgba(156,163,175,0.3);
}

/* Modern Grid System */
.modern-grid {
  display: grid;
  gap: var(--spacing-md);
}

.modern-grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.modern-grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.modern-grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Modern Section */
.modern-section {
  margin-bottom: var(--spacing-xl);
}

.modern-section-header {
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px solid rgba(148,163,184,0.15);
}

.modern-section-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #e5e7eb;
  margin: 0 0 var(--spacing-xs) 0;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.modern-section-subtitle {
  font-size: 0.9rem;
  color: #9ca3af;
  margin: 0;
  line-height: 1.6;
}

body.light .modern-section-title {
  color: #111827;
}

body.light .modern-section-subtitle {
  color: #6b7280;
}

body.light .modern-section-header {
  border-bottom-color: rgba(156,163,175,0.2);
}

/* Modern Button Variants */
.btn-modern {
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  transition: all var(--transition-base);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}

.btn-modern-primary {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(59,130,246,0.3);
}

.btn-modern-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59,130,246,0.4);
}

.btn-modern-secondary {
  background: rgba(30,41,59,0.7);
  border-color: rgba(148,163,184,0.3);
  color: #cbd5e1;
}

.btn-modern-secondary:hover {
  background: rgba(30,41,59,0.9);
  border-color: rgba(148,163,184,0.45);
  transform: translateY(-1px);
}

body.light .btn-modern-secondary {
  background: rgba(249,250,251,0.9);
  border-color: rgba(156,163,175,0.4);
  color: #4b5563;
}

body.light .btn-modern-secondary:hover {
  background: #ffffff;
  border-color: rgba(156,163,175,0.6);
}

/* Modern Stat Box */
.modern-stat-box {
  padding: var(--spacing-lg);
  background: rgba(30,41,59,0.6);
  border: 1px solid rgba(148,163,184,0.2);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

.modern-stat-box:hover {
  background: rgba(30,41,59,0.8);
  border-color: rgba(148,163,184,0.3);
  transform: translateY(-2px);
}

.modern-stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
  margin-bottom: var(--spacing-sm);
  font-weight: 600;
}

.modern-stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: #e5e7eb;
  margin-bottom: var(--spacing-xs);
  line-height: 1;
}

.modern-stat-desc {
  font-size: 0.85rem;
  color: #94a3b8;
  margin: 0;
}

body.light .modern-stat-box {
  background: rgba(249,250,251,0.8);
  border-color: rgba(156,163,175,0.2);
}

body.light .modern-stat-label {
  color: #6b7280;
}

body.light .modern-stat-value {
  color: #111827;
}

body.light .modern-stat-desc {
  color: #4b5563;
}

/* Modern List Item */
.modern-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md);
  background: rgba(30,41,59,0.5);
  border: 1px solid rgba(148,163,184,0.15);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  margin-bottom: var(--spacing-sm);
}

.modern-list-item:hover {
  background: rgba(30,41,59,0.7);
  border-color: rgba(148,163,184,0.25);
  transform: translateX(4px);
}

.modern-list-item-content {
  flex: 1;
}

.modern-list-item-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: #e5e7eb;
  margin-bottom: var(--spacing-xs);
}

.modern-list-item-meta {
  font-size: 0.8rem;
  color: #94a3b8;
}

body.light .modern-list-item {
  background: rgba(249,250,251,0.8);
  border-color: rgba(156,163,175,0.2);
}

body.light .modern-list-item-title {
  color: #111827;
}

body.light .modern-list-item-meta {
  color: #6b7280;
}

/* Modern Empty State */
.modern-empty-state {
  text-align: center;
  padding: var(--spacing-2xl) var(--spacing-lg);
  background: rgba(30,41,59,0.4);
  border: 1px dashed rgba(148,163,184,0.3);
  border-radius: var(--radius-lg);
  margin: var(--spacing-xl) 0;
}

.modern-empty-icon {
  font-size: 4rem;
  margin-bottom: var(--spacing-md);
  opacity: 0.5;
}

.modern-empty-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #e5e7eb;
  margin: 0 0 var(--spacing-sm) 0;
}

.modern-empty-description {
  font-size: 0.95rem;
  color: #a0aec0;
  margin: 0;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

body.light .modern-empty-state {
  background: rgba(249,250,251,0.6);
  border-color: rgba(156,163,175,0.3);
}

body.light .modern-empty-title {
  color: #111827;
}

body.light .modern-empty-description {
  color: #6b7280;
}

/* Modern Badge */
.modern-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(30,41,59,0.7);
  border: 1px solid rgba(148,163,184,0.3);
  color: #cbd5e1;
}

.modern-badge-primary {
  background: rgba(59,130,246,0.2);
  border-color: rgba(59,130,246,0.3);
  color: #60a5fa;
}

.modern-badge-success {
  background: rgba(34,197,94,0.2);
  border-color: rgba(34,197,94,0.3);
  color: #22c55e;
}

.modern-badge-warning {
  background: rgba(251,191,36,0.2);
  border-color: rgba(251,191,36,0.3);
  color: #fbbf24;
}

.modern-badge-danger {
  background: rgba(239,68,68,0.2);
  border-color: rgba(239,68,68,0.3);
  color: #ef4444;
}

body.light .modern-badge {
  background: rgba(249,250,251,0.9);
  border-color: rgba(156,163,175,0.4);
  color: #4b5563;
}

/* Modern Divider */
.modern-divider {
  height: 1px;
  background: rgba(148,163,184,0.15);
  border: none;
  margin: var(--spacing-lg) 0;
}

body.light .modern-divider {
  background: rgba(156,163,175,0.2);
}

/* Modern Progress Bar */
.modern-progress {
  width: 100%;
  height: 8px;
  background: rgba(30,41,59,0.5);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: var(--spacing-sm) 0;
}

.modern-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

body.light .modern-progress {
  background: rgba(243,244,246,0.8);
}

/* Modern Filter Bar */
.modern-filter-bar {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
  padding: var(--spacing-md);
  background: rgba(30,41,59,0.4);
  border: 1px solid rgba(148,163,184,0.2);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-lg);
}

.modern-filter-chip {
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  background: rgba(30,41,59,0.6);
  border: 1px solid rgba(148,163,184,0.3);
  color: #cbd5e1;
  text-decoration: none;
  transition: all var(--transition-base);
}

.modern-filter-chip:hover {
  background: rgba(30,41,59,0.8);
  border-color: rgba(148,163,184,0.4);
  transform: translateY(-1px);
}

.modern-filter-chip.active {
  background: rgba(59,130,246,0.2);
  border-color: rgba(59,130,246,0.4);
  color: #60a5fa;
}

body.light .modern-filter-bar {
  background: rgba(249,250,251,0.6);
  border-color: rgba(156,163,175,0.3);
}

body.light .modern-filter-chip {
  background: rgba(255,255,255,0.9);
  border-color: rgba(156,163,175,0.4);
  color: #4b5563;
}

body.light .modern-filter-chip.active {
  background: rgba(59,130,246,0.15);
  border-color: rgba(59,130,246,0.3);
  color: #2563eb;
}

/* Light Mode Support for Inline Styles */
/* Override all hardcoded dark mode colors in light mode */
body.light [style*="color:#e5e7eb"],
body.light h3[style*="color:#e5e7eb"],
body.light h4[style*="color:#e5e7eb"],
body.light p[style*="color:#e5e7eb"],
body.light div[style*="color:#e5e7eb"],
body.light span[style*="color:#e5e7eb"],
body.light label[style*="color:#e5e7eb"],
body.light strong[style*="color:#e5e7eb"] {
  color: #111827 !important;
}

body.light [style*="color:#cbd5e1"],
body.light p[style*="color:#cbd5e1"],
body.light div[style*="color:#cbd5e1"],
body.light span[style*="color:#cbd5e1"],
body.light ul[style*="color:#cbd5e1"],
body.light li[style*="color:#cbd5e1"] {
  color: #4b5563 !important;
}

body.light [style*="color:#9ca3af"],
body.light p[style*="color:#9ca3af"],
body.light div[style*="color:#9ca3af"],
body.light span[style*="color:#9ca3af"] {
  color: #6b7280 !important;
}

/* Input fields */
body.light input[style*="background:rgba(15,23,42"],
body.light input[style*="background:rgba(15,23,42,0.5)"] {
  background: rgba(255,255,255,0.9) !important;
  border-color: rgba(156,163,175,0.4) !important;
  color: #111827 !important;
}

body.light input[style*="color:#e5e7eb"] {
  color: #111827 !important;
}

/* Links in light mode - keep blue but adjust if needed */
body.light a[style*="color:#60a5fa"] {
  color: #2563eb !important;
}

/* Specific element overrides */
body.light #cardContainer div[style*="color:#e5e7eb"] {
  color: #111827 !important;
}

body.light #cardContainer div[style*="color:#cbd5e1"] {
  color: #4b5563 !important;
}

body.light #completionScreen h2[style*="color:#e5e7eb"] {
  color: #111827 !important;
}

body.light #completionScreen p[style*="color:#9ca3af"] {
  color: #6b7280 !important;
}

body.light #completionScreen strong[style*="color:#e5e7eb"] {
  color: #111827 !important;
}

/* Completion stats - keep colors but adjust for light mode readability */
body.light #completionGood[style*="color:#22c55e"] {
  color: #16a34a !important;
}

body.light #completionWrong[style*="color:#ef4444"] {
  color: #dc2626 !important;
}

body.light #completionHard[style*="color:#fbbf24"] {
  color: #d97706 !important;
}

/* Break suggestion text */
body.light #breakSuggestionContainer strong[style*="color:#fbbf24"] {
  color: #d97706 !important;
}

body.light #breakSuggestionContainer span[style*="color:#cbd5e1"] {
  color: #4b5563 !important;
}

body.light #breakCardCount {
  color: #111827 !important;
}

/* Responsive */
@media (max-width: 768px) {
  .modern-grid-2,
  .modern-grid-3,
  .modern-grid-4 {
    grid-template-columns: 1fr;
  }
  
  .modern-section-title {
    font-size: 1.1rem;
  }
  
  .modern-stat-value {
    font-size: 1.75rem;
  }
}

