/* ═══════════════════════════════════════════════════════════════════════════════
   ISSE v3 CSS — Streaming-First Search Result Styles
   ═══════════════════════════════════════════════════════════════════════════════
   Components:
   1. Loading Skeleton + Progress Bar
   2. Canvas Summary
   3. Knowledge Cards (streaming)
   4. Image Row
   5. Hover Summary Overlays
   6. Animations & Transitions
   7. Responsive Breakpoints
   ═══════════════════════════════════════════════════════════════════════════════ */


/* ═══════════════════════════════════════════════════════════════════════════
   1. LOADING SKELETON — Progress Bar + Shimmer Placeholders
   ═══════════════════════════════════════════════════════════════════════════ */

.v3-loading-skeleton {
    width: 100%;
    padding: 12px 0;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.v3-loading-skeleton.visible {
    opacity: 1;
    transform: translateY(0);
}

.v3-loading-skeleton.fade-out {
    opacity: 0;
    transform: translateY(-12px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
}

/* --- Progress Container --- */
.v3-progress-container {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    padding: 0 4px;
}

.v3-progress-bar {
    flex: 1;
    height: 3px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
    position: relative;
}

.v3-progress-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--accent-nanoverse, #00f0ff), #38bdf8);
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.v3-progress-fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: -2px;
    width: 8px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-nanoverse, #00f0ff);
    box-shadow: 0 0 10px var(--accent-nanoverse, #00f0ff);
    opacity: 0.9;
}

.v3-progress-label {
    font-family: var(--font-body, 'Poppins', sans-serif);
    font-size: 11.5px;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
    letter-spacing: 0.3px;
    min-width: 100px;
    text-align: right;
}

/* --- Skeleton Shimmer Lines --- */
.v3-skel-line {
    height: 14px;
    border-radius: 8px;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.04) 0%,
        rgba(255, 255, 255, 0.08) 40%,
        rgba(255, 255, 255, 0.04) 80%
    );
    background-size: 200% 100%;
    animation: v3Shimmer 1.8s ease infinite;
    margin-bottom: 10px;
}

.v3-skel-title {
    width: 60%;
    height: 20px;
    margin-bottom: 12px;
}

.v3-skel-subtitle {
    width: 40%;
    height: 14px;
    margin-bottom: 16px;
}

.v3-skel-desc {
    width: 90%;
}

.v3-skel-desc.short {
    width: 65%;
}

/* --- Skeleton Canvas Cards Row --- */
.v3-skel-cards-row {
    display: flex;
    gap: 12px;
    margin-top: 18px;
    margin-bottom: 24px;
}

.v3-skel-card {
    flex: 1;
    height: 72px;
    border-radius: 12px;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.03) 0%,
        rgba(255, 255, 255, 0.06) 40%,
        rgba(255, 255, 255, 0.03) 80%
    );
    background-size: 200% 100%;
    animation: v3Shimmer 1.8s ease infinite;
}

.v3-skel-card:nth-child(2) { animation-delay: 0.2s; }
.v3-skel-card:nth-child(3) { animation-delay: 0.4s; }

/* --- Skeleton Result Placeholders --- */
.v3-skeleton-results {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.v3-skel-result {
    height: 80px;
    border-radius: 14px;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.025) 0%,
        rgba(255, 255, 255, 0.05) 40%,
        rgba(255, 255, 255, 0.025) 80%
    );
    background-size: 200% 100%;
    animation: v3Shimmer 1.8s ease infinite;
}

.v3-skel-result:nth-child(2) { animation-delay: 0.15s; }
.v3-skel-result:nth-child(3) { animation-delay: 0.3s; }
.v3-skel-result:nth-child(4) { animation-delay: 0.45s; }
.v3-skel-result:nth-child(5) { animation-delay: 0.6s; }

@keyframes v3Shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   2. V3 CANVAS — Enhancement styles for original .knowledge-panel layout
   ═══════════════════════════════════════════════════════════════════════════ */

/* Related Searches (V3 enhancement added below the knowledge panel) */
.v3-canvas-related {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 8px;
}

.v3-related-label {
    font-family: var(--font-body, 'Poppins', sans-serif);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.v3-related-chip {
    padding: 5px 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    font-family: var(--font-body, 'Poppins', sans-serif);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.v3-related-chip:hover {
    background: rgba(0, 240, 255, 0.08);
    border-color: rgba(0, 240, 255, 0.2);
    color: var(--accent-nanoverse, #00f0ff);
    transform: translateY(-1px);
}

/* Standalone cards section (when no canvas available yet) */
.v3-cards-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 24px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   3-4. KNOWLEDGE CARDS & IMAGES — Uses original .fact-card and .panel-gallery
   No V3-specific overrides needed — original new-style.css handles layout.
   ═══════════════════════════════════════════════════════════════════════════ */


/* ═══════════════════════════════════════════════════════════════════════════
   5. HOVER SUMMARY ENRICHMENT — Visual Indicators
   ═══════════════════════════════════════════════════════════════════════════ */

.v3-enriched {
    position: relative;
}

.v3-enriched::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent-nanoverse, #00f0ff);
    opacity: 0.6;
}


/* ═══════════════════════════════════════════════════════════════════════════
   6. WEB RESULTS SECTION (V3 Override Styles)
   ═══════════════════════════════════════════════════════════════════════════ */

.v3-web-results-section {
    width: 100%;
}

/* Fallback web result cards (when web-results-engine.js not available) */
.v3-web-result {
    padding: 16px 20px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
    opacity: 0;
    animation: v3FadeSlideIn 0.4s ease forwards;
}

.v3-web-result:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.v3-web-result a {
    text-decoration: none;
    color: inherit;
}

.v3-web-title {
    font-family: var(--font-body, 'Poppins', sans-serif);
    font-size: 15px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.88);
    margin: 0 0 4px;
    line-height: 1.4;
}

.v3-web-url {
    font-family: var(--font-body, 'Poppins', sans-serif);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
    margin: 0 0 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v3-web-snippet {
    font-family: var(--font-body, 'Poppins', sans-serif);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.55);
    margin: 0;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* ═══════════════════════════════════════════════════════════════════════════
   7. ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

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

@keyframes v3PulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 240, 255, 0.15); }
    50% { box-shadow: 0 0 0 6px rgba(0, 240, 255, 0); }
}


/* ═══════════════════════════════════════════════════════════════════════════
   8. RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .v3-cards-section {
        flex-direction: column;
    }

    .v3-skel-cards-row {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .v3-progress-label {
        display: none;
    }
}
