/**
 * Animal Modal - Premium Design
 * Full-screen modal with smooth animations and glassmorphism
 */

@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');

/* ========================================
   Modal Base
   ======================================== */

.modal-animal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-animal.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Backdrop */
.modal-animal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ========================================
   Modal Container
   ======================================== */

.modal-animal-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    background: white;
    border-radius: 32px;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Close Button */
.modal-animal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 10;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.modal-animal-close:hover {
    background: white;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.modal-animal-close svg {
    color: #64748B;
    transition: color 0.3s ease;
}

.modal-animal-close:hover svg {
    color: #0F172A;
}

/* ========================================
   Modal Content
   ======================================== */

.modal-animal-content {
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(14, 165, 233, 0.3) transparent;
}

.modal-animal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-animal-content::-webkit-scrollbar-track {
    background: transparent;
    margin: 12px 0;
}

.modal-animal-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #0EA5E9, #06B6D4);
    border-radius: 10px;
}

.modal-animal-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #0284C7, #0891B2);
}

/* ========================================
   Modal Header with Image
   ======================================== */

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

.modal-animal-image-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
}

.modal-animal-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-animal-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(0, 0, 0, 0.02) 50%,
        rgba(14, 165, 233, 0.08) 100%
    );
}

/* Badge */
.modal-animal-badge {
    position: absolute;
    bottom: 1.5rem;
    left: 1.5rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.625rem 1.25rem;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    color: #0EA5E9;
    border: 1px solid rgba(14, 165, 233, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.modal-animal-badge.urgent {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    color: white;
    border-color: transparent;
}

/* ========================================
   Modal Body
   ======================================== */

.modal-animal-body {
    padding: 2.5rem;
}

/* Title Section */
.modal-animal-title-section {
    margin-bottom: 2rem;
}

.modal-animal-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    color: #0F172A;
    margin: 0 0 0.75rem;
    letter-spacing: -0.02em;
}

.modal-animal-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1rem;
    color: #64748B;
    font-weight: 500;
}

.modal-meta-separator {
    color: #CBD5E1;
}

/* Section Styling */
.modal-animal-description-section,
.modal-animal-traits-section {
    margin-bottom: 2rem;
}

.modal-section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    color: #0F172A;
    margin: 0 0 1rem;
    letter-spacing: -0.01em;
}

.modal-animal-description {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.0625rem;
    line-height: 1.8;
    color: #475569;
    margin: 0;
}

/* Traits Tags */
.modal-animal-traits {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
}

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

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

/* ========================================
   Details Grid
   ======================================== */

.modal-animal-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.modal-detail-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    background: rgba(240, 249, 255, 0.5);
    border-radius: 16px;
    border: 1px solid rgba(14, 165, 233, 0.1);
    transition: all 0.3s ease;
}

.modal-detail-item:hover {
    background: rgba(240, 249, 255, 0.8);
    border-color: rgba(14, 165, 233, 0.2);
    transform: translateY(-2px);
}

.modal-detail-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(6, 186, 199, 0.08) 100%);
    border-radius: 12px;
    border: 1px solid rgba(14, 165, 233, 0.15);
}

.modal-detail-icon svg {
    color: #0EA5E9;
}

.modal-detail-content {
    flex: 1;
}

.modal-detail-label {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #64748B;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.modal-detail-value {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #0F172A;
}

/* ========================================
   Modal Footer
   ======================================== */

.modal-animal-footer {
    padding: 2rem 2.5rem;
    border-top: 1px solid rgba(226, 232, 240, 0.8);
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(248, 250, 252, 0.5);
}

.modal-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    color: white;
    background: linear-gradient(135deg, #0EA5E9 0%, #06B6D4 100%);
    border-radius: 14px;
    box-shadow:
        0 6px 20px 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;
}

.modal-btn-primary::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;
}

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

.modal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow:
        0 10px 28px rgba(14, 165, 233, 0.45),
        0 0 0 4px rgba(14, 165, 233, 0.15);
}

.modal-btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    color: #0EA5E9;
    background: white;
    border: 2px solid rgba(14, 165, 233, 0.2);
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.modal-btn-outline:hover {
    background: #F0F9FF;
    border-color: #0EA5E9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
}

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

@media (max-width: 1024px) {
    .modal-animal {
        padding: 1.5rem;
    }

    .modal-animal-container {
        max-width: 700px;
    }

    .modal-animal-header {
        height: 350px;
    }

    .modal-animal-title {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .modal-animal {
        padding: 1rem;
    }

    .modal-animal-header {
        height: 300px;
    }

    .modal-animal-body {
        padding: 2rem 1.5rem;
    }

    .modal-animal-title {
        font-size: 1.75rem;
    }

    .modal-animal-details-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .modal-animal-footer {
        padding: 1.5rem;
        flex-direction: column;
    }

    .modal-btn-primary,
    .modal-btn-outline {
        width: 100%;
        justify-content: center;
    }

    .modal-animal-close {
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .modal-animal-header {
        height: 250px;
    }

    .modal-animal-body {
        padding: 1.5rem 1.25rem;
    }

    .modal-animal-title {
        font-size: 1.5rem;
    }

    .modal-animal-description {
        font-size: 1rem;
    }

    .modal-detail-item {
        padding: 1rem;
    }
}

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

@media (prefers-reduced-motion: reduce) {
    .modal-animal-backdrop,
    .modal-animal-container {
        animation: none;
    }

    .modal-animal-close,
    .modal-detail-item,
    .modal-btn-primary,
    .modal-btn-outline {
        transition: none;
    }
}
