/* ============================================
   JASMINE KNOWLEDGE BASE — IMAGES CSS
   Comprehensive illustration and diagram styles
   ============================================ */

/* ==================== IMAGE FRAME SYSTEM ==================== */
.image-frame {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: linear-gradient(145deg, #fafaf5, #f0efe8);
    border: 1px solid rgba(0,0,0,0.06);
    margin: var(--space-xl) 0;
}

.image-frame svg {
    width: 100%;
    height: auto;
    display: block;
}

.image-frame .image-caption {
    padding: var(--space-md) var(--space-lg);
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(0,0,0,0.04);
    font-size: 0.85rem;
    color: var(--neutral-500);
    font-style: italic;
}

.image-frame .image-caption strong {
    color: var(--neutral-700);
    font-style: normal;
}

/* Photo-style frame */
.photo-frame {
    position: relative;
    padding: 10px;
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: 0 2px 12px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.05);
    margin: var(--space-lg) 0;
}

.photo-frame .photo-inner {
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: linear-gradient(145deg, #fafaf5, #f0efe8);
}

.photo-frame svg {
    width: 100%;
    height: auto;
    display: block;
}

.photo-frame .photo-label {
    position: absolute;
    bottom: 15px;
    left: 15px;
    right: 15px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--neutral-600);
    font-weight: 500;
}

/* ==================== SPECIES ILLUSTRATION CARDS ==================== */
.species-img-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-lg);
    background: linear-gradient(145deg, #fafaf5, #f0efe8);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0,0,0,0.04);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.species-img-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.species-img-card svg {
    width: 180px;
    height: 180px;
    margin-bottom: var(--space-md);
    transition: transform 0.5s ease;
}

.species-img-card:hover svg {
    transform: scale(1.08) rotate(3deg);
}

.species-img-card .species-name {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--neutral-800);
    margin-bottom: var(--space-xs);
}

.species-img-card .species-latin {
    font-style: italic;
    color: var(--neutral-500);
    font-size: 0.9rem;
    margin-bottom: var(--space-sm);
}

.species-img-card .species-tags {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
    justify-content: center;
}

.species-img-card .species-tag {
    padding: 3px 10px;
    background: rgba(107,143,90,0.1);
    color: var(--primary-600);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* ==================== SPECIES GRID ==================== */
.species-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-xl);
    margin: var(--space-xl) 0;
}

/* ==================== DIAGRAM CONTAINER ==================== */
.diagram-container {
    margin: var(--space-xl) 0;
    padding: var(--space-lg);
    background: linear-gradient(145deg, #fafaf5, #f0efe8);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0,0,0,0.04);
}

.diagram-container .diagram-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--neutral-800);
    margin-bottom: var(--space-md);
    text-align: center;
}

.diagram-container svg {
    width: 100%;
    height: auto;
    display: block;
}

.diagram-container .diagram-caption {
    text-align: center;
    font-size: 0.85rem;
    color: var(--neutral-500);
    margin-top: var(--space-md);
    font-style: italic;
}

/* ==================== PROCESS FLOW DIAGRAMS ==================== */
.process-flow {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    overflow-x: auto;
    padding: var(--space-lg) 0;
    margin: var(--space-xl) 0;
    -webkit-overflow-scrolling: touch;
}

.process-flow .flow-step {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
    text-align: center;
}

.process-flow .flow-step .step-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
    border: 2px solid;
    transition: transform 0.3s ease;
}

.process-flow .flow-step:hover .step-icon {
    transform: scale(1.1);
}

.process-flow .flow-step .step-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--neutral-700);
}

.process-flow .flow-step .step-desc {
    font-size: 0.75rem;
    color: var(--neutral-500);
    margin-top: 2px;
}

.process-flow .flow-arrow {
    flex: 0 0 auto;
    width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--neutral-400);
    font-size: 1.2rem;
}

/* ==================== INFOGRAPHIC CARDS ==================== */
.infographic {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
    margin: var(--space-xl) 0;
}

.info-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-xl);
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0,0,0,0.06);
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.info-card .info-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
}

.info-card .info-value {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-600);
    line-height: 1;
    margin-bottom: var(--space-xs);
}

.info-card .info-label {
    font-size: 0.85rem;
    color: var(--neutral-500);
    font-weight: 500;
}

/* ==================== SIDE-BY-SIDE COMPARISON ==================== */
.side-by-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
    margin: var(--space-xl) 0;
    align-items: start;
}

.side-by-side .side {
    padding: var(--space-lg);
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0,0,0,0.06);
}

.side-by-side .side svg {
    width: 100%;
    max-height: 250px;
    margin-bottom: var(--space-md);
}

.side-by-side .side h4 {
    margin-bottom: var(--space-sm);
}

/* ==================== ILLUSTRATION GALLERY ==================== */
.illustration-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-lg);
    margin: var(--space-xl) 0;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: linear-gradient(145deg, #fafaf5, #f0efe8);
    border: 1px solid rgba(0,0,0,0.04);
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.02);
}

.gallery-item svg {
    width: 100%;
    height: 200px;
    display: block;
    object-fit: contain;
    padding: var(--space-md);
}

.gallery-item .gallery-label {
    padding: var(--space-md);
    background: rgba(255,255,255,0.9);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--neutral-700);
}

/* ==================== ANIMATED DIAGRAM ELEMENTS ==================== */
.animated-diagram {
    position: relative;
}

.animated-diagram .pulse-dot {
    animation: pulse 2s ease-in-out infinite;
}

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

.animated-diagram .flow-arrow-animated {
    animation: flow-right 1.5s ease-in-out infinite;
}

@keyframes flow-right {
    0%, 100% { transform: translateX(0); opacity: 1; }
    50% { transform: translateX(5px); opacity: 0.7; }
}

/* Water drop animation */
.water-drop {
    animation: drip 2s ease-in infinite;
}

@keyframes drip {
    0% { transform: translateY(0); opacity: 0.8; }
    80% { transform: translateY(15px); opacity: 0.4; }
    100% { transform: translateY(20px); opacity: 0; }
}

/* Steam animation */
.steam-wisp {
    animation: steam-rise 3s ease-out infinite;
    opacity: 0;
}

@keyframes steam-rise {
    0% { transform: translateY(0) scale(1); opacity: 0; }
    20% { opacity: 0.4; }
    100% { transform: translateY(-30px) scale(1.5); opacity: 0; }
}

/* ==================== RESPONSIVE ILLUSTRATIONS ==================== */
@media (max-width: 1024px) {
    .species-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }

    .species-img-card svg {
        width: 140px;
        height: 140px;
    }

    .side-by-side {
        grid-template-columns: 1fr;
    }

    .infographic {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
}

@media (max-width: 768px) {
    .species-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }

    .species-img-card {
        padding: var(--space-md);
    }

    .species-img-card svg {
        width: 110px;
        height: 110px;
    }

    .process-flow {
        flex-wrap: nowrap;
        padding-bottom: var(--space-md);
    }

    .infographic {
        grid-template-columns: repeat(2, 1fr);
    }

    .illustration-gallery {
        grid-template-columns: 1fr;
    }

    .diagram-container {
        padding: var(--space-md);
    }

    .photo-frame {
        padding: 6px;
    }
}

@media (max-width: 480px) {
    .species-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-sm);
    }

    .species-img-card svg {
        width: 90px;
        height: 90px;
    }

    .species-img-card .species-name {
        font-size: 0.9rem;
    }

    .infographic {
        grid-template-columns: 1fr;
    }
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .image-frame,
    .photo-frame,
    .diagram-container {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .animated-diagram .pulse-dot,
    .animated-diagram .flow-arrow-animated,
    .water-drop,
    .steam-wisp {
        animation: none;
        opacity: 1;
    }
}
