/* ============================================
   SPECIES GUIDE MODAL - PREMIUM REDESIGN
   Aesthetic: Editorial Nature Magazine
   ============================================ */

/* Import distinctive fonts */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Source+Sans+3:wght@300;400;500;600&display=swap');

/* Custom properties for species modal */
.species-modal-redesign {
    --sm-gold: #C9A227;
    --sm-gold-light: #E8D48A;
    --sm-gold-dark: #8B6914;
    --sm-deep-blue: #0A2540;
    --sm-ocean: #0267A1;
    --sm-water: #E8F4F8;
    --sm-sand: #F5F1E8;
    --sm-ink: #1A1A2E;
    --sm-slate: #64748B;
    --sm-cream: #FFFEF9;

    --sm-font-display: 'Playfair Display', Georgia, serif;
    --sm-font-body: 'Source Sans 3', -apple-system, sans-serif;

    --sm-shadow-soft: 0 4px 20px rgba(10, 37, 64, 0.08);
    --sm-shadow-lifted: 0 12px 40px rgba(10, 37, 64, 0.15);
}

/* Modal Container Override */
#speciesDetailModal .modal-dialog {
    max-width: 720px;
}

#speciesDetailModal .modal-content {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--sm-shadow-lifted);
    background: var(--sm-cream);
}

/* Remove default modal header - we'll integrate it differently */
#speciesDetailModal .modal-header {
    display: none;
}

/* Modal Body - Full Bleed */
#speciesDetailModal .modal-body {
    padding: 0;
    font-family: var(--sm-font-body);
    color: var(--sm-ink);
}

/* ============================================
   HERO SECTION - Fish Image with Depth
   ============================================ */
.species-hero {
    position: relative;
    background: linear-gradient(135deg, var(--sm-water) 0%, #D4E8F0 50%, var(--sm-sand) 100%);
    padding: 2.5rem 2rem 1.5rem;
    overflow: hidden;
}

/* Topographic texture overlay */
.species-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 50 Q25 30 50 50 T100 50' fill='none' stroke='%230267A1' stroke-width='0.3' opacity='0.1'/%3E%3Cpath d='M0 70 Q25 50 50 70 T100 70' fill='none' stroke='%230267A1' stroke-width='0.3' opacity='0.08'/%3E%3Cpath d='M0 30 Q25 10 50 30 T100 30' fill='none' stroke='%230267A1' stroke-width='0.3' opacity='0.06'/%3E%3C/svg%3E");
    background-size: 200px 200px;
    pointer-events: none;
    opacity: 0.7;
}

/* Close button - floating top right */
.species-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    color: var(--sm-slate);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.species-close-btn:hover {
    background: var(--sm-deep-blue);
    color: white;
    transform: scale(1.05);
}

/* Fish Image Container */
.species-image-wrap {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    margin-bottom: 1rem;
}

.species-image-wrap img {
    max-height: 280px;
    max-width: 100%;
    object-fit: contain;
    filter: drop-shadow(0 8px 24px rgba(10, 37, 64, 0.2));
    transition: transform 0.4s ease;
}

.species-image-wrap:hover img {
    transform: scale(1.02);
}

/* Image placeholder */
.species-image-placeholder {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sm-slate);
    font-size: 3rem;
}

/* Species Name & Scientific Name */
.species-naming {
    text-align: center;
    position: relative;
    z-index: 1;
}

.species-common-name {
    font-family: var(--sm-font-display);
    font-size: 2.25rem;
    font-weight: 600;
    color: var(--sm-deep-blue);
    margin: 0 0 0.25rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.species-scientific-name {
    font-family: var(--sm-font-display);
    font-style: italic;
    font-size: 1.1rem;
    color: var(--sm-slate);
    margin: 0;
    font-weight: 400;
    opacity: 0.8;
}

/* ============================================
   RECORD ACHIEVEMENT STRIP
   Museum plaque style - full width, proud
   ============================================ */
.species-record-strip {
    background: linear-gradient(135deg, #FEF9E7 0%, #FDF6E3 50%, #FCF3D9 100%);
    border-top: 1px solid var(--sm-gold-light);
    border-bottom: 1px solid var(--sm-gold-light);
    padding: 1.25rem 2rem;
    position: relative;
    overflow: hidden;
}

/* Subtle gold shimmer effect */
.species-record-strip::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(201, 162, 39, 0.1) 50%, transparent 100%);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translateX(-25%); }
    50% { transform: translateX(25%); }
}

.record-strip-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.record-trophy {
    font-size: 1.5rem;
    color: var(--sm-gold);
    filter: drop-shadow(0 2px 4px rgba(139, 105, 20, 0.3));
}

.record-label {
    font-family: var(--sm-font-body);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--sm-gold-dark);
}

.record-weight {
    font-family: var(--sm-font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--sm-deep-blue);
    letter-spacing: -0.02em;
}

.record-separator {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--sm-gold);
    opacity: 0.6;
}

.record-meta {
    font-family: var(--sm-font-body);
    font-size: 0.95rem;
    color: var(--sm-ink);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.record-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.record-meta-item i {
    color: var(--sm-gold);
    font-size: 0.85rem;
}

.record-meta-divider {
    color: var(--sm-gold-light);
    font-weight: 300;
}

/* ============================================
   CONTENT SECTION
   ============================================ */
.species-content {
    padding: 1.5rem 2rem 2rem;
}

/* Stats Row - No borders, floating with icons */
.species-stats-row {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(100, 116, 139, 0.1);
}

.species-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.species-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.species-stat-icon.habitat {
    background: linear-gradient(135deg, #E0F2FE 0%, #BAE6FD 100%);
    color: #0369A1;
}

.species-stat-icon.season {
    background: linear-gradient(135deg, #DCFCE7 0%, #BBF7D0 100%);
    color: #15803D;
}

.species-stat-icon.weight {
    background: linear-gradient(135deg, #F3E8FF 0%, #E9D5FF 100%);
    color: #7C3AED;
}

.species-stat-value {
    font-family: var(--sm-font-body);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--sm-ink);
    margin-bottom: 0.15rem;
}

.species-stat-label {
    font-family: var(--sm-font-body);
    font-size: 0.75rem;
    color: var(--sm-slate);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Description Section */
.species-description-section {
    margin-bottom: 1.5rem;
}

.species-description {
    font-family: var(--sm-font-body);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--sm-ink);
    max-width: 60ch;
    margin: 0;
}

.species-description:first-letter {
    font-family: var(--sm-font-display);
    font-size: 2.5em;
    float: left;
    line-height: 0.8;
    padding-right: 0.1em;
    color: var(--sm-ocean);
    font-weight: 600;
}

/* Conservation Status */
.species-conservation {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.species-conservation.lc {
    background: #DCFCE7;
    color: #166534;
}

.species-conservation.nt {
    background: #FEF9C3;
    color: #854D0E;
}

.species-conservation.vu {
    background: #FFEDD5;
    color: #C2410C;
}

.species-conservation.en {
    background: #FEE2E2;
    color: #DC2626;
}

.species-conservation.cr {
    background: #FEE2E2;
    color: #991B1B;
}

/* Links Section */
.species-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(100, 116, 139, 0.1);
}

.species-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--sm-ocean);
    text-decoration: none;
    transition: color 0.2s;
}

.species-link:hover {
    color: var(--sm-deep-blue);
    text-decoration: underline;
}

/* Stats Section */
.species-catch-stats {
    background: var(--sm-water);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.species-catch-stats h6 {
    font-family: var(--sm-font-body);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sm-slate);
    margin: 0 0 0.75rem;
}

.species-catch-stats ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.species-catch-stats li {
    font-size: 0.9rem;
    color: var(--sm-ink);
}

/* Q&A Section - Compressed when empty */
.species-qa-section {
    border-top: 1px solid rgba(100, 116, 139, 0.1);
    padding-top: 1rem;
}

.species-qa-section.is-empty {
    padding: 1rem 0;
    text-align: center;
}

.species-qa-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
}

.species-qa-empty i {
    font-size: 1.5rem;
    color: var(--sm-slate);
    opacity: 0.4;
}

.species-qa-empty p {
    font-size: 0.85rem;
    color: var(--sm-slate);
    margin: 0;
}

.species-qa-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--sm-ocean);
    color: var(--sm-ocean);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.species-qa-cta:hover {
    background: var(--sm-ocean);
    color: white;
}

/* ============================================
   FOOTER - Intentionally Unequal Buttons
   ============================================ */
#speciesDetailModal .modal-footer {
    background: transparent;
    border-top: none;
    padding: 0 2rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-btn-close {
    background: var(--sm-deep-blue);
    color: white;
    border: none;
    padding: 0.65rem 1.75rem;
    border-radius: 8px;
    font-family: var(--sm-font-body);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-btn-close:hover {
    background: var(--sm-ink);
    transform: translateY(-1px);
}

.modal-admin-actions {
    display: flex;
    gap: 0.75rem;
}

.modal-btn-admin {
    background: transparent;
    color: var(--sm-slate);
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-family: var(--sm-font-body);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-btn-admin:hover {
    background: rgba(100, 116, 139, 0.1);
    color: var(--sm-ink);
}

/* Hide admin actions for non-admins */
body:not(.is-admin) .modal-admin-actions {
    display: none;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 576px) {
    .species-hero {
        padding: 2rem 1.25rem 1rem;
    }

    .species-common-name {
        font-size: 1.75rem;
    }

    .species-record-strip {
        padding: 1rem 1.25rem;
    }

    .record-strip-content {
        flex-direction: column;
        gap: 0.5rem;
    }

    .record-weight {
        font-size: 1.5rem;
    }

    .species-content {
        padding: 1.25rem;
    }

    .species-stats-row {
        gap: 1.25rem;
    }

    .species-stat-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    #speciesDetailModal .modal-footer {
        flex-direction: column-reverse;
        gap: 1rem;
        padding: 0 1.25rem 1.25rem;
    }

    .modal-btn-close {
        width: 100%;
    }
}

/* Dark mode support */
body.dark-mode .species-modal-redesign {
    --sm-cream: #1A1A2E;
    --sm-ink: #F5F5F5;
    --sm-slate: #94A3B8;
    --sm-water: rgba(2, 103, 161, 0.15);
    --sm-sand: #2A2A3E;
}

body.dark-mode .species-hero {
    background: linear-gradient(135deg, #1A2744 0%, #0F1729 50%, #1A1A2E 100%);
}

body.dark-mode .species-record-strip {
    background: linear-gradient(135deg, #2A2815 0%, #1F1D0F 50%, #2A2815 100%);
    border-color: rgba(201, 162, 39, 0.3);
}

body.dark-mode .species-close-btn {
    background: rgba(26, 26, 46, 0.9);
    color: #F5F5F5;
}

body.dark-mode .species-close-btn:hover {
    background: var(--sm-ocean);
}

body.dark-mode .species-catch-stats {
    background: rgba(2, 103, 161, 0.1);
}
