/* ============================================
   Favicon History / Archive Viewer
   Prefix: fvh-
   Green theme (#339966)
   ============================================ */

:root {
    --fvh-primary: #339966;
    --fvh-primary-light: #e6f4ee;
    --fvh-primary-dark: #267a52;
    --fvh-danger: #e64e4e;
    --fvh-danger-light: #fdecea;
    --fvh-warning: #f59e0b;
    --fvh-warning-light: #fef3c7;
    --fvh-bg: #f6fbf8;
    --fvh-bg-elevated: #ffffff;
    --fvh-bg-secondary: #eef7f2;
    --fvh-text: #1a2e24;
    --fvh-text-secondary: #3d5a47;
    --fvh-text-muted: #6b8c77;
    --fvh-border: #c3e0d0;
    --fvh-border-light: #dff0e8;
    --fvh-radius-sm: 6px;
    --fvh-radius-md: 10px;
    --fvh-radius-lg: 14px;
    --fvh-shadow-sm: 0 1px 3px rgba(0,0,0,0.07);
    --fvh-shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --fvh-transition: 0.2s ease;
}

[data-theme="dark"] {
    --fvh-primary: #4ade80;
    --fvh-primary-light: rgba(74,222,128,0.12);
    --fvh-primary-dark: #6ee7a0;
    --fvh-danger: #f87171;
    --fvh-danger-light: rgba(248,113,113,0.12);
    --fvh-warning: #fbbf24;
    --fvh-warning-light: rgba(251,191,36,0.12);
    --fvh-bg: #0d1a12;
    --fvh-bg-elevated: #122018;
    --fvh-bg-secondary: #172e1f;
    --fvh-text: #d4f0e0;
    --fvh-text-secondary: #8bbfa0;
    --fvh-text-muted: #5a8a6e;
    --fvh-border: #1e3d28;
    --fvh-border-light: #172e1f;
    --fvh-shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --fvh-shadow-md: 0 4px 12px rgba(0,0,0,0.4);
}

.fvh-wrap { max-width: 960px; margin: 0 auto; padding: 2rem 1.5rem 3rem; }

.fvh-header { text-align: center; margin-bottom: 2rem; }

.fvh-header h1 {
    font-size: 1.9rem; font-weight: 700; color: var(--fvh-text);
    display: flex; align-items: center; justify-content: center;
    gap: 0.5rem; margin: 0 0 0.6rem;
}

.fvh-header h1 svg { color: var(--fvh-primary); }

.fvh-description {
    max-width: 800px; margin: 0 auto;
    color: var(--fvh-text-secondary); font-size: 1rem; line-height: 1.7;
}

.fvh-card {
    background: var(--fvh-bg-elevated);
    border: 1px solid var(--fvh-border);
    border-radius: var(--fvh-radius-lg);
    padding: 1.75rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--fvh-shadow-sm);
}

.fvh-input-row {
    display: flex; gap: 0.75rem; align-items: center;
}

@media (max-width: 540px) { .fvh-input-row { flex-direction: column; } }

.fvh-url-input {
    flex: 1;
    background: var(--fvh-bg);
    border: 1px solid var(--fvh-border);
    border-radius: var(--fvh-radius-md);
    color: var(--fvh-text);
    font-size: 0.95rem;
    padding: 0.7rem 1rem;
    transition: border-color var(--fvh-transition), box-shadow var(--fvh-transition);
    font-family: inherit;
    width: 100%;
}

.fvh-url-input:focus {
    outline: none;
    border-color: var(--fvh-primary);
    box-shadow: 0 0 0 3px var(--fvh-primary-light);
}

.fvh-btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 0.45rem; font-size: 0.92rem; font-weight: 600;
    padding: 0.7rem 1.5rem; border-radius: var(--fvh-radius-md);
    border: none; cursor: pointer; transition: all var(--fvh-transition);
    font-family: inherit; white-space: nowrap;
}

.fvh-btn-primary { background: var(--fvh-primary); color: #fff; }
.fvh-btn-primary:hover { background: var(--fvh-primary-dark); }
.fvh-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.fvh-btn-secondary { background: var(--fvh-bg-secondary); color: var(--fvh-text-secondary); border: 1px solid var(--fvh-border); }
.fvh-btn-secondary:hover { opacity: 0.85; }

.fvh-hint-row { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-top: 0.75rem; }
.fvh-hint { display: flex; align-items: center; gap: 0.35rem; font-size: 0.8rem; color: var(--fvh-text-muted); }
.fvh-hint svg { color: var(--fvh-primary); }

.fvh-error {
    display: none;
    background: var(--fvh-danger-light);
    border: 1px solid rgba(230,78,78,0.2);
    border-radius: var(--fvh-radius-md);
    padding: 0.85rem 1rem;
    color: var(--fvh-danger);
    font-size: 0.88rem;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.fvh-error.visible { display: flex; }
.fvh-error svg { flex-shrink: 0; margin-top: 1px; }
.fvh-error a { color: inherit; font-weight: 600; }

/* Loading */
.fvh-loading { display: none; text-align: center; padding: 2.5rem 1rem; }
.fvh-loading.visible { display: block; }
.fvh-spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--fvh-border);
    border-top-color: var(--fvh-primary);
    border-radius: 50%;
    animation: fvhSpin 0.8s linear infinite;
    margin: 0 auto 1rem;
}
@keyframes fvhSpin { to { transform: rotate(360deg); } }
.fvh-loading p { color: var(--fvh-text-secondary); font-size: 0.92rem; margin: 0; }
.fvh-loading .fvh-loading-sub { font-size: 0.8rem; color: var(--fvh-text-muted); margin-top: 0.35rem; }

/* Domain summary */
.fvh-summary {
    display: none;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}
.fvh-summary.visible { display: flex; }

.fvh-current-favicon {
    width: 56px; height: 56px;
    border-radius: var(--fvh-radius-md);
    border: 1px solid var(--fvh-border);
    overflow: hidden;
    background: #fff;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.fvh-current-favicon img { width: 100%; height: 100%; object-fit: contain; }

.fvh-summary-info h3 { font-size: 1rem; font-weight: 700; color: var(--fvh-text); margin: 0 0 0.2rem; }
.fvh-summary-info p  { font-size: 0.83rem; color: var(--fvh-text-muted); margin: 0; }

.fvh-summary-actions { margin-left: auto; display: flex; gap: 0.5rem; }

/* Timeline */
.fvh-timeline-wrap { display: none; }
.fvh-timeline-wrap.visible { display: block; }

.fvh-section-title {
    font-size: 1rem; font-weight: 700; color: var(--fvh-text);
    display: flex; align-items: center; gap: 0.45rem;
    margin: 0 0 1rem;
}
.fvh-section-title svg { color: var(--fvh-primary); }

/* Year filter */
.fvh-year-filter {
    display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.25rem;
}

.fvh-year-btn {
    font-size: 0.8rem; font-weight: 500;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    border: 1px solid var(--fvh-border);
    background: var(--fvh-bg-elevated);
    color: var(--fvh-text-secondary);
    cursor: pointer;
    transition: all var(--fvh-transition);
    font-family: inherit;
}

.fvh-year-btn.active {
    background: var(--fvh-primary);
    border-color: var(--fvh-primary);
    color: #fff;
}

.fvh-year-btn:hover:not(.active) { background: var(--fvh-bg-secondary); }

/* Grid */
.fvh-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.85rem;
}

.fvh-icon-card {
    background: var(--fvh-bg-elevated);
    border: 1px solid var(--fvh-border);
    border-radius: var(--fvh-radius-md);
    padding: 0.9rem;
    text-align: center;
    transition: box-shadow var(--fvh-transition), transform var(--fvh-transition);
    cursor: pointer;
}

.fvh-icon-card:hover {
    box-shadow: var(--fvh-shadow-md);
    transform: translateY(-1px);
}

.fvh-icon-card.selected {
    border-color: var(--fvh-primary);
    box-shadow: 0 0 0 2px var(--fvh-primary-light);
}

.fvh-icon-preview {
    width: 48px; height: 48px;
    border-radius: 8px;
    margin: 0 auto 0.6rem;
    background: #fff;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    border: 1px solid var(--fvh-border-light);
}

.fvh-icon-preview img {
    width: 100%; height: 100%; object-fit: contain;
}

.fvh-icon-date {
    font-size: 0.75rem; font-weight: 600;
    color: var(--fvh-text-secondary);
    margin-bottom: 0.1rem;
}

.fvh-icon-year {
    font-size: 0.7rem; color: var(--fvh-text-muted);
}

.fvh-icon-actions {
    display: flex; gap: 0.35rem; justify-content: center; margin-top: 0.6rem;
}

.fvh-icon-btn {
    display: inline-flex; align-items: center; gap: 0.25rem;
    font-size: 0.72rem; font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: var(--fvh-radius-sm);
    border: 1px solid var(--fvh-border);
    background: var(--fvh-bg-secondary);
    color: var(--fvh-text-secondary);
    cursor: pointer; text-decoration: none;
    transition: all var(--fvh-transition); font-family: inherit;
}

.fvh-icon-btn:hover {
    background: var(--fvh-primary); color: #fff; border-color: var(--fvh-primary);
}

/* Stats bar */
.fvh-stats {
    display: flex; gap: 1.5rem; flex-wrap: wrap;
    padding: 0.85rem 1rem;
    background: var(--fvh-bg-secondary);
    border-radius: var(--fvh-radius-md);
    margin-bottom: 1.25rem;
    border: 1px solid var(--fvh-border-light);
}

.fvh-stat {
    display: flex; flex-direction: column; gap: 0.1rem;
}

.fvh-stat-num { font-size: 1.25rem; font-weight: 800; color: var(--fvh-primary); }
.fvh-stat-label { font-size: 0.75rem; color: var(--fvh-text-muted); }

/* Empty */
.fvh-empty { display: none; text-align: center; padding: 2.5rem; color: var(--fvh-text-muted); }
.fvh-empty.visible { display: block; }
.fvh-empty svg { color: var(--fvh-border); margin-bottom: 0.75rem; }
.fvh-empty p { font-size: 0.9rem; margin: 0; }

/* Info / Related / FAQ */
.fvh-related-box {
    background: var(--fvh-bg-elevated);
    border: 1px solid var(--fvh-border);
    border-radius: var(--fvh-radius-lg);
    padding: 1rem 1.25rem;
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    box-shadow: var(--fvh-shadow-sm); margin-top: 2rem;
}

.fvh-related-label {
    font-size: 0.82rem; font-weight: 600; color: var(--fvh-text-muted);
    display: flex; align-items: center; gap: 0.35rem; white-space: nowrap;
}
.fvh-related-label svg { color: var(--fvh-primary); }
.fvh-related-links { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.fvh-related-link {
    display: inline-flex; align-items: center; gap: 0.35rem;
    font-size: 0.83rem; font-weight: 500; color: var(--fvh-primary);
    text-decoration: none; padding: 0.3rem 0.7rem;
    border: 1px solid var(--fvh-border); border-radius: 20px;
    background: var(--fvh-primary-light); transition: all var(--fvh-transition);
}
.fvh-related-link:hover { background: var(--fvh-primary); color: #fff; border-color: var(--fvh-primary); }

.fvh-info-card {
    background: var(--fvh-bg-elevated); border: 1px solid var(--fvh-border);
    border-radius: var(--fvh-radius-lg); padding: 1.75rem;
    margin-bottom: 1.25rem; margin-top: 1.25rem; box-shadow: var(--fvh-shadow-sm);
}

.fvh-info-card h2 {
    font-size: 1.15rem; font-weight: 700; color: var(--fvh-text);
    display: flex; align-items: center; gap: 0.5rem; margin: 0 0 1rem;
}
.fvh-info-card h2 svg { color: var(--fvh-primary); }
.fvh-info-card p { color: var(--fvh-text-secondary); font-size: 0.92rem; line-height: 1.75; margin: 0 0 0.75rem; }
.fvh-info-card p:last-child { margin-bottom: 0; }
.fvh-info-card a { color: var(--fvh-primary); text-decoration: none; }
.fvh-info-card a:hover { text-decoration: underline; }

.fvh-steps-list { padding-left: 1.3rem; color: var(--fvh-text-secondary); font-size: 0.92rem; line-height: 1.8; }
.fvh-steps-list li { margin-bottom: 0.35rem; }

.fvh-faq-list { display: flex; flex-direction: column; gap: 0.5rem; }
.fvh-faq-item { border: 1px solid var(--fvh-border); border-radius: var(--fvh-radius-md); overflow: hidden; }

.fvh-faq-question {
    width: 100%; background: none; border: none; padding: 0.9rem 1rem;
    display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
    cursor: pointer; font-size: 0.9rem; font-weight: 600; color: var(--fvh-text);
    text-align: left; font-family: inherit; transition: background var(--fvh-transition);
}
.fvh-faq-question:hover { background: var(--fvh-bg-secondary); }
.fvh-faq-question svg { flex-shrink: 0; color: var(--fvh-text-muted); transition: transform 0.2s; }
.fvh-faq-item.active .fvh-faq-question svg { transform: rotate(180deg); }
.fvh-faq-answer { display: none; padding: 0 1rem 0.9rem; }
.fvh-faq-item.active .fvh-faq-answer { display: block; }
.fvh-faq-answer p { color: var(--fvh-text-secondary); font-size: 0.88rem; line-height: 1.7; margin: 0; }
.fvh-faq-answer a { color: var(--fvh-primary); text-decoration: none; }
.fvh-faq-answer a:hover { text-decoration: underline; }

@media (max-width: 640px) {
    .fvh-wrap { padding: 1.25rem 1rem 2rem; }
    .fvh-card { padding: 1.25rem; }
    .fvh-header h1 { font-size: 1.5rem; }
    .fvh-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}
