/* LifeVed Devotional — Base Styles (Premium 9.5+ Target)
   Reset, Typography, Utilities, Layout Primitives */

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: var(--lh-normal);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 8px);
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); line-height: var(--lh-tight); color: var(--text-primary); font-weight: 700; }
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }

p { line-height: var(--lh-normal); color: var(--text-secondary); }
a { color: var(--accent); text-decoration: none; transition: color var(--duration) var(--ease-in-out); }
a:hover { color: var(--accent-hover); }
img, svg { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 100%; }
strong { font-weight: 700; color: var(--text-primary); }

/* === LAYOUT === */
.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 var(--space-md); }
.container-narrow { max-width: var(--content-width); margin: 0 auto; padding: 0 var(--space-md); }

/* === UTILITY CLASSES === */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.fs-xs { font-size: var(--fs-xs); }
.fs-sm { font-size: var(--fs-sm); }
.fs-base { font-size: var(--fs-base); }
.fs-lg { font-size: var(--fs-lg); }
.fs-xl { font-size: var(--fs-xl); }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-size: var(--fs-sm);
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all var(--duration) var(--ease-out);
    min-height: 48px;
    position: relative;
    overflow: hidden;
}
.btn-primary {
    background: var(--accent-gradient);
    color: var(--text-on-accent);
    box-shadow: var(--shadow-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(212,82,10,0.25); color: #fff; }
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1.5px solid var(--border-strong);
}
.btn-secondary:hover { border-color: var(--accent); background: var(--accent-glow); }

.btn-icon {
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    transition: all var(--duration);
}
.btn-icon:hover { background: var(--accent-glow); color: var(--accent); }

/* === BADGE === */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: var(--fs-xs);
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}
.badge-accent { background: var(--accent-glow); color: var(--accent); border: 1px solid rgba(212,82,10,0.15); }
.badge-gold { background: rgba(198,153,62,0.1); color: var(--temple-gold); border: 1px solid rgba(198,153,62,0.2); }
.badge-spiritual { background: var(--spiritual-glow); color: var(--spiritual); border: 1px solid rgba(107,33,168,0.15); }
.badge-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(22,163,74,0.15); }

/* === CARD (Base) === */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--duration) var(--ease-out);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-elevated { box-shadow: var(--shadow-md); }
.card-elevated:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

/* === CHIPS (Filter) === */
.chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0 12px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
    flex-shrink: 0;
    padding: 9px 16px;
    border-radius: var(--radius-full);
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border);
    text-decoration: none;
    transition: all var(--duration);
    white-space: nowrap;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
}
.chip.active, .chip:hover { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: var(--shadow-glow); }

/* === TOAST === */
.toast {
    position: fixed;
    bottom: calc(var(--nav-height) + 16px);
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--glass-dark);
    color: var(--text-on-dark);
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-size: var(--fs-sm);
    font-weight: 600;
    z-index: var(--z-toast);
    transition: transform 0.3s var(--ease-spring);
    backdrop-filter: blur(12px);
    pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* === MODAL OVERLAY === */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(26,15,5,0.5);
    backdrop-filter: blur(4px);
    z-index: 99990;
    display: none;
    align-items: center;
    justify-content: center;
}
.modal-content {
    background: var(--bg-card);
    width: 92%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 24px 64px rgba(26,15,5,0.3);
}

@media (max-width: 640px) {
    .modal-overlay { align-items: flex-end; }
    .modal-content { width: 100%; border-radius: 20px 20px 0 0; max-height: 80vh; }
}

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: var(--space-3xl) var(--space-lg);
    color: var(--text-muted);
}
.empty-state p { font-size: var(--fs-base); margin-bottom: var(--space-md); }

/* === RIPPLE EFFECT === */
.ripple-effect {
    position: absolute;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: rgba(212,82,10,0.2);
    animation: rippleAnim 0.6s ease-out forwards;
    pointer-events: none;
}
@keyframes rippleAnim {
    to { width: 200px; height: 200px; margin: -100px 0 0 -100px; opacity: 0; }
}

/* === CONFETTI === */
.confetti-piece {
    position: fixed;
    width: 10px; height: 10px;
    top: -10px;
    z-index: 999;
    animation: confettiFall 3s ease-in forwards;
}
@keyframes confettiFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* === SKELETON LOADING === */
.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-card) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
