@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700;900&display=swap');

:root {
    --salem-primary: #0062a9;
    --salem-accent: #4da3ff;
    --salem-secondary: #004e8a;
    --salem-soft-blue: #e0f2fe;
    --salem-support: #f59e0b;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
}

/* ─── Header Styles ─── */
#main-header {
    transition: all 0.5s ease;
}

#main-header.scrolled {
    backdrop-filter: blur(8px);
    background-color: rgba(255, 255, 255, 0.9) !important;
    border-bottom-color: #dbeafe;
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.08);
}

#main-header .nav-link {
    transition: color 0.3s ease;
}

#main-header.scrolled .nav-link {
    color: #334155;
}

#main-header.scrolled .nav-link:hover {
    color: #0062a9;
}

/* ─── Active Link Styles ─── */
.active-link {
    color: #fde68a !important;
    font-weight: 800 !important;
}

#main-header.scrolled .active-link {
    color: #0062a9 !important;
}

.mobile-nav-link.active-link-mobile {
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 1rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ─── Animations ─── */
@keyframes bounce-slow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
.animate-bounce-slow {
    animation: bounce-slow 2.5s infinite ease-in-out;
}

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

@keyframes reveal {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-reveal {
    animation: reveal 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}
.animate-slide-left {
    animation: slideInLeft 0.8s ease-out forwards;
}

@keyframes pulse-soft {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.05); opacity: 1; }
}

/* ─── Delay Utilities ─── */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }

/* ─── Common UI Components ─── */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

.glass-dark {
    background: rgba(0, 78, 138, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.gradient-text {
    background: linear-gradient(135deg, var(--salem-primary) 0%, var(--salem-accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-gradient {
    background: radial-gradient(circle at top right, rgba(77, 163, 255, 0.1) 0%, transparent 40%),
        radial-gradient(circle at bottom left, rgba(0, 98, 169, 0.05) 0%, transparent 40%);
}

.category-tag {
    background: linear-gradient(90deg, var(--salem-primary), var(--salem-accent));
    box-shadow: 0 4px 12px rgba(0, 98, 169, 0.2);
}

.card-hover {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.card-hover:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.floating-blob {
    position: absolute;
    width: 400px;
    height: 400px;
    background: var(--salem-accent);
    filter: blur(80px);
    opacity: 0.1;
    z-index: 0;
    pointer-events: none;
    border-radius: 50%;
}

.purpose-card {
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}
.purpose-card:hover {
    background: white;
    border-left-color: var(--salem-primary);
    transform: translateX(10px);
    box-shadow: 0 10px 30px rgba(0, 98, 169, 0.05);
}

.purpose-description {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.5s ease-in-out;
}
.purpose-card:hover .purpose-description {
    max-height: 200px;
    opacity: 1;
    margin-top: 0.5rem;
}

.touch-indicator {
    display: none;
}
@media (max-width: 1024px) {
    .touch-indicator {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        font-size: 0.65rem;
        font-weight: 900;
        text-transform: uppercase;
        letter-spacing: 0.15em;
        color: var(--salem-primary);
        background: white;
        padding: 0.35rem 0.85rem;
        border-radius: 99px;
        box-shadow: 0 4px 15px rgba(0, 98, 169, 0.15);
        animation: pulse-soft 2.5s infinite ease-in-out;
        margin-bottom: 0.75rem;
        border: 1px solid rgba(0, 98, 169, 0.1);
    }
}

.glass-blue-overlay {
    position: relative;
}
.glass-blue-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(77, 163, 255, 0.1), rgba(0, 98, 169, 0.05));
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    pointer-events: none;
    border-radius: inherit;
    z-index: 10;
}

/* ─── Index Components ─── */
.carousel-item {
    transition: opacity 1s ease-in-out;
}
.hero-text-shadow {
    text-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}
.news-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: 1.5rem;
    padding: 1rem 0.5rem;
}
.news-carousel::-webkit-scrollbar {
    display: none;
}
.news-card {
    flex: 0 0 100%;
    scroll-snap-align: start;
}
@media (min-width: 768px) {
    .news-card {
        flex: 0 0 calc(33.333% - 1rem);
    }
}
@media (min-width: 1024px) {
    .news-card {
        flex: 0 0 calc(25% - 1.125rem);
    }
}

/* ─── Project Specific Variables ─── */
:root {
    /* Biblioteca */
    --library-paper: #fdfaf6;
    --library-ink: #1e293b;
    --library-accent: #78350f;
    --library-highlight: #d97706;
    --mindole-magenta: #e91e63;
    --mindole-yellow: #ffc107;
    --mindole-green: #4caf50;
    --mindole-blue: #2196f3;
    --mindole-orange: #ff9800;

    /* Campanas */
    --salem-alert: #ef4444;
    --salem-safety: #3b82f6;
    --salem-peace: #f0fdf4;

    /* Desarrollo */
    --salem-warm: #f59e0b;
    --salem-peace: #8b5cf6;

    /* Nutricion */
    --salem-nature: #10b981;

    /* Plan */
    --salem-sky: #4da3ff;

    /* Talleres */
    --salem-craft: #a855f7;
    --salem-work: #64748b;
    --salem-leaf: #22c55e;
}

/* ─── Project Specific Classes ─── */
/* Biblioteca */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideRight {
    from { transform: translateX(-30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
.reveal { animation: fadeIn 1.2s ease-out forwards; }
.slide-in { animation: slideRight 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}
.section-border { border-bottom: 1px solid #e2e8f0; }
.library-hero {
    background: radial-gradient(circle at top right, rgba(217, 119, 6, 0.05) 0%, transparent 40%),
        radial-gradient(circle at bottom left, rgba(0, 98, 169, 0.05) 0%, transparent 40%);
}
.vertical-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

/* Campanas */
.card-zoom { transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
.card-zoom:hover { transform: scale(1.03); }
.prevention-gradient { background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%); }

/* Desarrollo */
.result-card {
    @apply bg-white p-8 rounded-[2.5rem] shadow-sm border border-slate-100 transition-all duration-500 hover:shadow-xl;
}

/* Nutricion */
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 98, 169, 0.2); }
    50% { box-shadow: 0 0 40px rgba(0, 98, 169, 0.4); }
}

/* Plan */
.step-number {
    @apply w-12 h-12 rounded-2xl flex items-center justify-center font-black text-xl mb-6;
}

/* Talleres */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.animate-slide-up { animation: slideUp 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
.animate-scale-in { animation: scaleIn 0.8s ease-out forwards; }
.workshop-card {
    @apply transition-all duration-500 hover:shadow-2xl hover:-translate-y-2 border border-slate-100;
}
.pill-tag {
    @apply px-4 py-1.5 rounded-full text-[10px] font-black uppercase tracking-widest border;
}
