/**
 * Featured Animals Section - Modern Design
 * Dynamic cards with glassmorphism and premium interactions
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

/* ========================================
   Featured Section
   ======================================== */

.featured-section {
    padding: 6rem 0;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 1) 0%,
        rgba(240, 249, 255, 0.4) 50%,
        rgba(255, 255, 255, 1) 100%
    );
    position: relative;
    overflow: hidden;
}

/* Section Header */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

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

.section-label {
    display: inline-block;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #0EA5E9;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(6, 186, 199, 0.08) 100%);
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(14, 165, 233, 0.2);
}

.section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.2;
    color: #0F172A;
    margin: 0 0 1rem;
    letter-spacing: -0.02em;
}

.section-description {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.125rem;
    line-height: 1.7;
    color: #64748B;
    max-width: 600px;
    margin: 0 auto;
}

/* ========================================
   Animals Grid
   ======================================== */

.animals-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s backwards;
}

/* ========================================
   Animal Card
   ======================================== */

.animal-card {
    position: relative;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.06),
        0 0 0 1px rgba(14, 165, 233, 0.04);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    user-select: none;
    animation: cardReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

/* Staggered card animations */
.animal-card:nth-child(1) { animation-delay: 0.1s; }
.animal-card:nth-child(2) { animation-delay: 0.2s; }
.animal-card:nth-child(3) { animation-delay: 0.3s; }

@keyframes cardReveal {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Gradient border on hover */
.animal-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    padding: 2px;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.4), rgba(6, 186, 199, 0.4));
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.animal-card:hover::before {
    opacity: 1;
}

.animal-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow:
        0 20px 40px rgba(14, 165, 233, 0.15),
        0 0 0 1px rgba(14, 165, 233, 0.1);
    background: rgba(255, 255, 255, 0.95);
}

.animal-card:active {
    transform: translateY(-8px) scale(1.01);
    transition-duration: 0.1s;
}

/* ========================================
   Card Image
   ======================================== */

.animal-card-image-wrapper {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

.animal-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animal-card:hover .animal-card-image {
    transform: scale(1.1);
}

/* Urgent Badge */
.animal-card-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    color: white;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    z-index: 2;
    animation: pulse 2s ease-in-out infinite;
}

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

/* ========================================
   Card Content
   ======================================== */

.animal-card-content {
    padding: 1.75rem;
}

.animal-card-header {
    margin-bottom: 1rem;
}

.animal-card-name {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #0F172A;
    margin: 0 0 0.5rem;
    letter-spacing: -0.02em;
}

.animal-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.875rem;
    color: #64748B;
}

.animal-card-separator {
    color: #CBD5E1;
}

.animal-card-description {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #64748B;
    margin-bottom: 1.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========================================
   Traits Tags
   ======================================== */

.animal-card-traits {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.trait-tag {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #0EA5E9;
    background: rgba(14, 165, 233, 0.1);
    padding: 0.375rem 0.875rem;
    border-radius: 50px;
    border: 1px solid rgba(14, 165, 233, 0.2);
    transition: all 0.3s ease;
}

.animal-card:hover .trait-tag {
    background: rgba(14, 165, 233, 0.15);
    border-color: rgba(14, 165, 233, 0.3);
}

/* ========================================
   Card Footer CTA
   ======================================== */

.animal-card-footer {
    border-top: 1px solid rgba(226, 232, 240, 0.8);
    padding-top: 1.25rem;
}

.animal-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.9375rem;
    font-weight: 700;
    color: #0EA5E9;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.animal-card-cta svg {
    transition: transform 0.3s ease;
}

.animal-card:hover .animal-card-cta {
    transform: translateX(4px);
}

.animal-card:hover .animal-card-cta svg {
    transform: translateX(4px);
}

/* ========================================
   Section CTA Button
   ======================================== */

.section-cta {
    text-align: center;
    margin-top: 4rem;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.5s backwards;
}

.btn-primary-large {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.125rem 2.5rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.0625rem;
    font-weight: 700;
    text-decoration: none;
    color: white;
    background: linear-gradient(135deg, #0EA5E9 0%, #06B6D4 100%);
    border-radius: 16px;
    box-shadow:
        0 8px 24px rgba(14, 165, 233, 0.35),
        0 0 0 0 rgba(14, 165, 233, 0.3);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-primary-large::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.btn-primary-large:hover::before {
    opacity: 1;
}

.btn-primary-large:hover {
    transform: translateY(-3px);
    box-shadow:
        0 12px 32px rgba(14, 165, 233, 0.45),
        0 0 0 6px rgba(14, 165, 233, 0.15);
}

.btn-primary-large svg {
    transition: transform 0.35s ease;
}

.btn-primary-large:hover svg {
    transform: translateX(5px);
}

/* ========================================
   Loading & Error States
   ======================================== */

.loading-state,
.error-state,
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
}

.loading-state p,
.error-state p,
.empty-state p {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.125rem;
    color: #64748B;
    margin-bottom: 1rem;
}

.error-state p {
    color: #EF4444;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 1200px) {
    .animals-grid {
        max-width: 100%;
        gap: 1.75rem;
    }
}

@media (max-width: 1024px) {
    .animals-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }

    .section-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 900px) {
    .animals-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .featured-section {
        padding: 4rem 0;
    }

    .section-header {
        margin-bottom: 3rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .section-description {
        font-size: 1rem;
    }

    .animal-card-image-wrapper {
        height: 240px;
    }

    .animal-card:hover {
        transform: translateY(-6px) scale(1.01);
    }
}

@media (max-width: 600px) {
    .animals-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    /* Hide first animal on mobile - show only last 2 */
    .animal-card:first-child {
        display: none;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 1.75rem;
    }

    .animal-card-content {
        padding: 1.5rem;
    }

    .animal-card-name {
        font-size: 1.25rem;
    }

    .btn-primary-large {
        width: 100%;
        max-width: 320px;
        justify-content: center;
    }
}

/* ========================================
   Accessibility
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    .animal-card,
    .section-header,
    .section-cta,
    .animal-card-image {
        animation: none;
        transition: none;
    }

    .animal-card-badge {
        animation: none;
    }
}
