/* ========================================
   RUNELYTICS - GILDED PARCHMENT REDESIGN
   Medieval manuscript meets modern gaming
   ======================================== */

/* Google Fonts - Distinctive serif pairing */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=Spectral:wght@300;400;500;600;700&display=swap');

/* ========================================
   CSS VARIABLES - COLOR SYSTEM
   ======================================== */

:root, [data-theme="dark"] {
  /* Parchment & Charcoal Palette */
  --parchment-50: #F8F4ED;
  --parchment-100: #E8DCC8;
  --parchment-200: #D4C5A8;
  --charcoal-900: #1A1512;
  --charcoal-800: #2C1F18;
  --charcoal-700: #3E2923;
  --charcoal-600: #4A3327;

  /* Gilded Accents */
  --gold-500: #D4AF37;
  --gold-400: #E6C757;
  --gold-300: #F5E190;
  --crimson-600: #8B1A1A;
  --crimson-500: #B82E24;
  --crimson-400: #D64136;

  /* Semantic Colors */
  --bg: var(--charcoal-900);
  --bg-elevated: var(--charcoal-800);
  --panel: var(--charcoal-800);
  --panel-raised: var(--charcoal-700);
  --border: rgba(212, 175, 55, 0.15);
  --border-strong: rgba(212, 175, 55, 0.3);
  --text: var(--parchment-50);
  --text-muted: rgba(248, 244, 237, 0.6);
  --text-subtle: rgba(248, 244, 237, 0.4);
  --accent: var(--gold-500);
  --accent-hover: var(--gold-400);
  --danger: var(--crimson-400);
  --success: #4A7C59;

  /* Effects */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-inset: inset 0 2px 8px rgba(0, 0, 0, 0.3);
  --glow-gold: 0 0 20px rgba(212, 175, 55, 0.3);

  /* Textures */
  --noise: 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.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.05'/%3E%3C/svg%3E");
  --grain: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.5' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23grain)' opacity='0.03'/%3E%3C/svg%3E");
}

[data-theme="light"] {
  --bg: #EAE0D5;
  --bg-elevated: #F5EFE7;
  --panel: var(--parchment-50);
  --panel-raised: #FFFFFF;
  --border: rgba(62, 41, 35, 0.15);
  --border-strong: rgba(62, 41, 35, 0.3);
  --text: var(--charcoal-900);
  --text-muted: rgba(26, 21, 18, 0.6);
  --text-subtle: rgba(26, 21, 18, 0.4);
  --accent: #C8861A;
  --accent-hover: var(--gold-500);
  --danger: var(--crimson-500);
  --success: #2D5A3D;

  --shadow-sm: 0 2px 8px rgba(62, 41, 35, 0.1);
  --shadow-md: 0 4px 16px rgba(62, 41, 35, 0.15);
  --shadow-lg: 0 8px 32px rgba(62, 41, 35, 0.2);
  --shadow-inset: inset 0 2px 8px rgba(62, 41, 35, 0.08);
  --glow-gold: 0 0 20px rgba(200, 134, 26, 0.2);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Spectral', Georgia, serif;
  font-weight: 400;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  position: relative;
  overflow-x: hidden;
}

/* Texture overlay on body */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: var(--grain);
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: overlay;
  opacity: 0.4;
}

/* Display typography */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
  line-height: 1.2;
  margin-bottom: 0.75em;
}

h1, .h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2, .h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
}

h3, .h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 600;
}

h4, .h4, h5, .h5, h6, .h6 {
  font-size: 1.125rem;
  font-weight: 600;
}

/* Body text */
p {
  margin-bottom: 1em;
}

.lead {
  font-size: 1.125rem;
  font-weight: 300;
  letter-spacing: 0.01em;
}

small, .small {
  font-size: 0.875rem;
}

.text-muted, .muted {
  color: var(--text-muted) !important;
}

/* ========================================
   LAYOUT STRUCTURE
   ======================================== */

.app-shell {
  min-height: 100vh;
  display: flex;
  background: var(--bg);
}

/* Sidebar */
.sidebar {
  width: 300px;
  background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--panel) 40%, var(--bg) 100%);
  border-right: 3px solid var(--border-strong);
  padding: 24px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: inset -4px 0 12px rgba(0, 0, 0, 0.2);
  position: relative;
}

/* Decorative border */
.sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg,
    transparent 0%,
    var(--accent) 20%,
    var(--accent) 80%,
    transparent 100%);
  opacity: 0.3;
  pointer-events: none;
}

.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
  opacity: 0.5;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--accent-hover);
}

/* Main content */
.content {
  flex: 1;
  padding: 32px clamp(20px, 4vw, 48px);
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

/* ========================================
   BRAND & LOGO
   ======================================== */

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--border);
  position: relative;
}

/* Decorative flourish */
.brand::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

.brand-badge {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--crimson-600) 0%, var(--crimson-400) 100%);
  border: 3px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-weight: 900;
  font-size: 24px;
  color: var(--gold-300) !important;
  box-shadow: var(--shadow-inset), var(--glow-gold);
  position: relative;
  overflow: hidden;
}

/* Shine effect */
.brand-badge::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: shine 3s infinite;
}

@keyframes shine {
  0%, 100% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  50% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.brand span {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.05em;
  color: var(--text);
}

/* ========================================
   NAVIGATION
   ======================================== */

.navpill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 6px;
  border: 2px solid transparent;
  color: var(--text) !important;
  background: transparent;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Spectral', serif;
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  overflow: hidden;
}

.navpill::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.1), transparent);
  transition: left 0.5s;
}

.navpill:hover::before {
  left: 100%;
}

.navpill:hover {
  background: rgba(212, 175, 55, 0.08);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transform: translateX(4px);
}

.navpill.active {
  background: linear-gradient(135deg,
    rgba(212, 175, 55, 0.2) 0%,
    rgba(212, 175, 55, 0.1) 100%);
  border-color: var(--accent);
  box-shadow: var(--shadow-inset), var(--glow-gold);
  color: var(--accent-hover) !important;
}

/* Divider */
.divider {
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--border) 20%,
    var(--border-strong) 50%,
    var(--border) 80%,
    transparent 100%);
  margin: 20px 0;
  position: relative;
}

/* Decorative center point on dividers */
.divider::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.6);
}

/* ========================================
   CARDS & PANELS
   ======================================== */

.card {
  background: var(--panel) !important;
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  box-shadow: var(--shadow-sm) !important;
  color: var(--text) !important;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* Parchment texture */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: var(--noise);
  pointer-events: none;
  opacity: 0.3;
  mix-blend-mode: overlay;
  border-radius: 12px;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  border-color: var(--border);
}

.card-body {
  padding: 24px;
  position: relative;
  z-index: 1;
}

/* Decorative corner removed - was causing visible box artifact */

/* Card headers with illuminated style */
.card-header {
  background: linear-gradient(180deg,
    rgba(212, 175, 55, 0.15) 0%,
    rgba(212, 175, 55, 0.05) 100%);
  border-bottom: 2px solid var(--border-strong);
  padding: 16px 24px;
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--accent);
  position: relative;
}

.card-header::before {
  content: '❖';
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--accent);
  opacity: 0.5;
  margin-right: 12px;
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
  font-family: 'Spectral', serif;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 6px;
  border: 2px solid;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  text-transform: none;
  letter-spacing: 0.02em;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

/* Primary button - gilded */
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  border-color: var(--accent);
  color: var(--charcoal-900) !important;
  box-shadow: var(--shadow-sm), var(--glow-gold);
  font-weight: 700;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-hover) 0%, var(--gold-300) 100%);
  border-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), var(--glow-gold);
}

/* Outline buttons */
.btn-outline-light,
.btn-outline-secondary {
  background: rgba(0, 0, 0, 0.2);
  border-color: var(--border);
  color: var(--text) !important;
}

.btn-outline-light:hover,
.btn-outline-secondary:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--accent);
  color: var(--accent-hover) !important;
  box-shadow: var(--shadow-sm);
}

/* Active state for outline buttons */
.btn-outline-light.active,
.btn-outline-secondary.active,
.btn-outline-light:active,
.btn-outline-secondary:active {
  background: var(--charcoal-700) !important;
  border-color: var(--accent) !important;
  color: var(--accent-hover) !important;
  box-shadow: var(--shadow-inset), 0 0 0 2px rgba(212, 175, 55, 0.2) !important;
}

.btn-outline-success {
  border-color: var(--success);
  color: var(--success) !important;
}

.btn-outline-success:hover {
  background: var(--success);
  color: white !important;
}

.btn-outline-danger {
  border-color: var(--danger);
  color: var(--danger) !important;
}

.btn-outline-danger:hover {
  background: var(--danger);
  color: white !important;
}

/* Button sizes */
.btn-sm {
  padding: 6px 14px;
  font-size: 0.875rem;
}

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

/* ========================================
   BADGES & TAGS
   ======================================== */

.badge {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
  border: 2px solid var(--border);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  font-size: 0.75rem;
  font-family: 'Cinzel', serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: var(--shadow-inset);
}

.badge-warning,
.bg-warning {
  background: linear-gradient(135deg, var(--accent) 0%, var(--gold-400) 100%) !important;
  color: var(--charcoal-900) !important;
  border: 1px solid var(--gold-400);
}

.badge-success,
.bg-success {
  background: var(--success) !important;
  color: white !important;
}

.badge-secondary,
.bg-secondary {
  background: var(--charcoal-700) !important;
  color: var(--text-muted) !important;
}

/* ========================================
   TABLES
   ======================================== */

.table {
  color: var(--text);
  font-family: 'Spectral', serif;
}

.table thead th {
  background: linear-gradient(180deg,
    rgba(212, 175, 55, 0.15) 0%,
    rgba(212, 175, 55, 0.05) 100%);
  border-bottom: 2px solid var(--border-strong);
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  padding: 12px;
}

.table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.2s ease;
}

.table tbody tr:hover {
  background: rgba(212, 175, 55, 0.05);
}

.table td {
  padding: 12px;
  vertical-align: middle;
}

.table-sm td,
.table-sm th {
  padding: 8px;
}

/* ========================================
   FORMS
   ======================================== */

.form-label {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.form-control,
.form-select {
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 10px 14px;
  font-family: 'Spectral', serif;
  transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
  background: rgba(0, 0, 0, 0.4);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
  color: var(--text);
  outline: none;
}

.form-control::placeholder {
  color: var(--text-subtle);
  font-style: italic;
}

/* ========================================
   TABS
   ======================================== */

.nav-tabs {
  border-bottom: 2px solid var(--border-strong);
  gap: 4px;
}

.nav-tabs .nav-link {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  border: 2px solid transparent;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  padding: 10px 18px;
  transition: all 0.3s ease;
  position: relative;
  background: transparent;
}

.nav-tabs .nav-link:hover {
  color: var(--text);
  border-color: var(--border) var(--border) transparent;
  background: rgba(212, 175, 55, 0.05);
}

.nav-tabs .nav-link.active {
  color: var(--accent);
  background: var(--panel);
  border-color: var(--border-strong) var(--border-strong) transparent;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

/* Decorative marker on active tab */
.nav-tabs .nav-link.active::before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
}

/* ========================================
   ALERTS
   ======================================== */

.alert {
  border-radius: 8px;
  border: 2px solid;
  padding: 14px 18px;
  font-family: 'Spectral', serif;
  position: relative;
  overflow: hidden;
}

.alert::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: currentColor;
}

.alert-success {
  background: rgba(74, 124, 89, 0.15);
  border-color: var(--success);
  color: #6FBF8B;
}

.alert-danger {
  background: rgba(184, 46, 36, 0.15);
  border-color: var(--danger);
  color: #EF7B73;
}

.alert-warning {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--accent);
  color: var(--gold-300);
}

.alert-info {
  background: rgba(70, 130, 180, 0.15);
  border-color: #4682B4;
  color: #87CEEB;
}

/* ========================================
   DROPDOWNS
   ======================================== */

.dropdown-menu {
  background: var(--panel);
  border: 2px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  min-width: 200px;
}

.dropdown-item {
  font-family: 'Spectral', serif;
  padding: 8px 14px;
  border-radius: 4px;
  color: var(--text);
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background: rgba(212, 175, 55, 0.1);
  color: var(--accent-hover);
}

.dropdown-divider {
  border-color: var(--border);
  margin: 6px 0;
}

/* ========================================
   MODALS
   ======================================== */

.modal-content {
  background: var(--panel);
  border: 3px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: var(--shadow-lg), var(--glow-gold);
}

.modal-header {
  background: linear-gradient(180deg,
    rgba(212, 175, 55, 0.2) 0%,
    rgba(212, 175, 55, 0.05) 100%);
  border-bottom: 2px solid var(--border-strong);
  padding: 20px 24px;
}

.modal-title {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  color: var(--accent);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  border-top: 2px solid var(--border);
  padding: 16px 24px;
  background: rgba(0, 0, 0, 0.1);
}

/* ========================================
   PROGRESS BARS
   ======================================== */

.progress {
  height: 24px;
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-inset);
}

.progress-bar {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 0.75rem;
  line-height: 20px;
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

/* Animated shine on progress bar */
.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: progress-shine 2s infinite;
}

@keyframes progress-shine {
  to { left: 100%; }
}

/* ========================================
   IMAGES & ICONS
   ======================================== */

/* Remove backgrounds from all icons */
img {
  background: transparent !important;
  vertical-align: middle;
}

/* Ensure skill/boss/clue icons display properly */
img[src*="/icons/"] {
  background: none !important;
  image-rendering: crisp-edges;
  image-rendering: -webkit-optimize-contrast;
}

/* Fix list items with icons */
ul li img,
ol li img {
  background: transparent !important;
  margin-right: 6px;
}

/* Ensure card content doesn't clip */
.card-body {
  position: relative;
  z-index: 1;
  overflow: visible;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.text-accent {
  color: var(--accent) !important;
}

.text-gold {
  color: var(--gold-400) !important;
}

.border-accent {
  border-color: var(--accent) !important;
}

.bg-elevated {
  background: var(--bg-elevated) !important;
}

.shadow-glow {
  box-shadow: var(--glow-gold) !important;
}

/* Ornamental separator */
.ornament {
  text-align: center;
  color: var(--accent);
  font-size: 1.5rem;
  margin: 24px 0;
  opacity: 0.5;
}

.ornament::before {
  content: '◆ ❖ ◆';
  letter-spacing: 12px;
}

/* ========================================
   ANIMATIONS
   ======================================== */

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

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

.slide-in {
  animation: slideIn 0.6s ease-out;
}

/* Stagger children */
.stagger-children > * {
  animation: fadeIn 0.6s ease-out;
  animation-fill-mode: both;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.3s; }

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 992px) {
  .sidebar {
    width: 260px;
  }

  .content {
    padding: 24px 20px;
  }

  h1, .h1 {
    font-size: 2rem;
  }
}

@media (max-width: 768px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 3px solid var(--border-strong);
    position: static;
  }

  .sidebar::before {
    display: none;
  }

  .content {
    padding: 20px 16px;
  }

  .brand::after {
    display: none;
  }

  h1, .h1 {
    font-size: 1.75rem;
  }
}

/* ========================================
   CALENDAR STYLES
   ======================================== */

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 8px;
  padding: 0;
}

.calendar-weekday {
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gold-400);
  padding: 8px 4px;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.5px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: 0;
}

.calendar-cell {
  aspect-ratio: 1;
  background: var(--charcoal-700);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px;
  position: relative;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 60px;
}

.calendar-cell:hover {
  background: var(--charcoal-600);
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.calendar-cell.calendar-cell-active {
  background: var(--charcoal-600);
  border-color: var(--gold-500);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

.calendar-empty {
  background: transparent;
  border-color: transparent;
}

.calendar-empty:hover {
  background: transparent;
  border-color: transparent;
  transform: none;
  box-shadow: none;
}

.calendar-day {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* Intensity levels (GitHub-style heatmap) */
.calendar-cell.intensity-0 {
  background: var(--charcoal-700);
}

.calendar-cell.intensity-1 {
  background: rgba(74, 124, 89, 0.3);
  border-color: rgba(74, 124, 89, 0.5);
}

.calendar-cell.intensity-2 {
  background: rgba(74, 124, 89, 0.5);
  border-color: rgba(74, 124, 89, 0.7);
}

.calendar-cell.intensity-3 {
  background: rgba(74, 124, 89, 0.7);
  border-color: rgba(74, 124, 89, 0.9);
}

.calendar-cell.intensity-4 {
  background: rgba(74, 124, 89, 0.9);
  border-color: #4A7C59;
}

.calendar-cell.intensity-1 .calendar-day,
.calendar-cell.intensity-2 .calendar-day,
.calendar-cell.intensity-3 .calendar-day,
.calendar-cell.intensity-4 .calendar-day {
  color: var(--text);
}

/* Legend */
.calendar-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
}

.legend-cell {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 1px solid var(--border);
}

.legend-cell.intensity-0 {
  background: var(--charcoal-700);
}

.legend-cell.intensity-1 {
  background: rgba(74, 124, 89, 0.3);
}

.legend-cell.intensity-2 {
  background: rgba(74, 124, 89, 0.5);
}

.legend-cell.intensity-3 {
  background: rgba(74, 124, 89, 0.7);
}

.legend-cell.intensity-4 {
  background: rgba(74, 124, 89, 0.9);
}

/* Responsive calendar */
@media (max-width: 768px) {
  .calendar-cell {
    min-height: 50px;
    padding: 4px;
  }

  .calendar-day {
    font-size: 0.75rem;
  }

  .calendar-weekday {
    font-size: 0.75rem;
    padding: 6px 2px;
  }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
  body::before,
  .card::before {
    display: none;
  }

  .sidebar {
    display: none;
  }

  .content {
    padding: 0;
  }

  .card {
    box-shadow: none;
    border: 1px solid #000;
  }
}
