/**
 * BetaMeta 2026 Theme
 * Editorial brutalist design - investigative tool aesthetic
 */

/* ===== CSS Custom Properties ===== */
:root {
    /* Warm paper-inspired palette */
    --bg-primary: #f5f2eb;
    --bg-secondary: #ebe7dc;
    --bg-card: #ffffff;
    --bg-card-hover: #faf9f6;
    --bg-accent: #1a1a1a;

    /* Text colors - high contrast */
    --text-primary: #0d0d0d;
    --text-secondary: #4a4a4a;
    --text-muted: #8a8a8a;
    --text-inverse: #f5f2eb;

    /* Accent - single bold color */
    --accent-primary: #e63946;
    --accent-secondary: #1d3557;
    --accent-tertiary: #457b9d;
    --accent-success: #2d6a4f;
    --accent-warning: #e9c46a;
    --accent-error: #9d0208;

    /* Borders - sharp and defined */
    --border-heavy: 3px solid #0d0d0d;
    --border-medium: 2px solid #0d0d0d;
    --border-light: 1px solid #d4d0c4;
    --border-accent: 3px solid var(--accent-primary);

    /* Shadows - dramatic offset */
    --shadow-brutal: 6px 6px 0 #0d0d0d;
    --shadow-brutal-sm: 4px 4px 0 #0d0d0d;
    --shadow-brutal-accent: 6px 6px 0 var(--accent-primary);

    /* Spacing */
    --radius-none: 0;
    --radius-sm: 2px;
    --radius-md: 4px;

    /* Transitions */
    --transition-fast: 100ms ease-out;
    --transition-base: 200ms ease-out;
    --transition-slow: 350ms ease-out;
}

/* ===== Base Styles ===== */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;700;900&family=JetBrains+Mono:wght@400;500;600&family=Source+Serif+4:opsz,wght@8..60,400;8..60,600&display=swap');

* {
    box-sizing: border-box;
}

body {
    font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    font-size: 17px;
}

/* Editorial grid background */
.bg-gradient-animated {
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 40px,
            rgba(0,0,0,0.02) 40px,
            rgba(0,0,0,0.02) 41px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 40px,
            rgba(0,0,0,0.02) 40px,
            rgba(0,0,0,0.02) 41px
        ),
        var(--bg-primary);
}

/* ===== Editorial Card ===== */
.glass-card {
    background: var(--bg-card);
    border: var(--border-medium);
    border-radius: var(--radius-none);
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-brutal);
}

.glass-card:hover {
    background: var(--bg-card);
    transform: translate(-2px, -2px);
    box-shadow: 8px 8px 0 #0d0d0d;
}

/* ===== Editorial Input ===== */
.input-modern {
    width: 100%;
    padding: 18px 20px;
    background: var(--bg-card);
    border: var(--border-medium);
    border-radius: var(--radius-none);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 15px;
    transition: all var(--transition-fast);
}

.input-modern::placeholder {
    color: var(--text-muted);
    font-style: italic;
}

.input-modern:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-brutal-accent);
    transform: translate(-2px, -2px);
}

/* ===== Brutal Button ===== */
.btn-gradient {
    position: relative;
    padding: 16px 32px;
    background: var(--accent-primary);
    border: var(--border-medium);
    border-radius: var(--radius-none);
    color: white;
    font-family: 'Playfair Display', serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    overflow: hidden;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-brutal);
}

.btn-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.btn-gradient:hover {
    transform: translate(-3px, -3px);
    box-shadow: 9px 9px 0 #0d0d0d;
}

.btn-gradient:hover::before {
    left: 100%;
}

.btn-gradient:active {
    transform: translate(2px, 2px);
    box-shadow: 4px 4px 0 #0d0d0d;
}

.btn-gradient:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: var(--shadow-brutal);
}

/* ===== Section Headers ===== */
.section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: var(--bg-accent);
    cursor: pointer;
    transition: all var(--transition-fast);
    border-bottom: var(--border-medium);
}

.section-header:hover {
    background: #2a2a2a;
}

.section-header h3 {
    flex: 1;
    margin: 0;
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-inverse);
}

.section-header .icon {
    width: 24px;
    height: 24px;
    color: var(--accent-primary);
}

.section-header .chevron {
    width: 24px;
    height: 24px;
    color: var(--text-inverse);
    transition: transform var(--transition-fast);
}

.section-header.open .chevron {
    transform: rotate(180deg);
}

.section-header span.text-xs {
    color: rgba(255,255,255,0.6);
    font-family: 'Source Serif 4', serif;
    font-style: italic;
}

/* ===== Date Cards ===== */
.date-card-modern {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    padding: 20px 24px;
    background: var(--bg-card);
    border-bottom: var(--border-light);
    transition: all var(--transition-fast);
    position: relative;
}

.date-card-modern::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: transparent;
    transition: background var(--transition-fast);
}

.date-card-modern:hover {
    background: var(--bg-secondary);
}

.date-card-modern:hover::before {
    background: var(--accent-primary);
}

.date-card-modern .date-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    background: var(--bg-secondary);
    padding: 8px 12px;
    border: 1px solid var(--border-light);
}

.date-card-modern .date-details {
    flex: 1;
    min-width: 0;
}

.date-card-modern .date-context {
    font-size: 14px;
    color: var(--text-secondary);
    word-break: break-word;
    margin-top: 8px;
    font-style: italic;
}

/* ===== Source Badges - Editorial Tags ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border: 1px solid currentColor;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-ssl { border-color: #1d3557; color: #1d3557; background: rgba(29,53,87,0.08); }
.badge-crtsh { border-color: #457b9d; color: #457b9d; background: rgba(69,123,157,0.08); }
.badge-http { border-color: #6d597a; color: #6d597a; background: rgba(109,89,122,0.08); }
.badge-epoch { border-color: #e63946; color: #e63946; background: rgba(230,57,70,0.08); }
.badge-url { border-color: #f4a261; color: #c77a35; background: rgba(244,162,97,0.08); }
.badge-image { border-color: #e76f51; color: #e76f51; background: rgba(231,111,81,0.08); }
.badge-schema { border-color: #2a9d8f; color: #2a9d8f; background: rgba(42,157,143,0.08); }
.badge-meta { border-color: #264653; color: #264653; background: rgba(38,70,83,0.08); }
.badge-archive { border-color: #2d6a4f; color: #2d6a4f; background: rgba(45,106,79,0.08); }
.badge-comment { border-color: #bc6c25; color: #bc6c25; background: rgba(188,108,37,0.08); }
.badge-objectid { border-color: #7b2cbf; color: #7b2cbf; background: rgba(123,44,191,0.08); }
.badge-json { border-color: #588157; color: #588157; background: rgba(88,129,87,0.08); }
.badge-snowflake { border-color: #0077b6; color: #0077b6; background: rgba(0,119,182,0.08); }
.badge-default { border-color: var(--text-muted); color: var(--text-muted); background: rgba(0,0,0,0.03); }

/* ===== Loading Spinner - Editorial ===== */
.spinner-modern {
    width: 40px;
    height: 40px;
    border: 3px solid var(--text-primary);
    border-right-color: transparent;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Typewriter pulse for loading text */
.pulse-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    animation: blink 1s step-end infinite;
}

.pulse-text::after {
    content: '_';
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* ===== Progress Messages - Terminal Style ===== */
.progress-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--text-secondary);
    opacity: 0;
    transform: translateX(-10px);
    animation: slideIn 0.2s ease forwards;
    border-left: 2px solid var(--accent-success);
    padding-left: 12px;
    margin-left: 4px;
}

.progress-item .check {
    width: 16px;
    height: 16px;
    color: var(--accent-success);
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== Error Alert - Editorial ===== */
.alert-error {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 24px;
    background: #fff5f5;
    border: var(--border-medium);
    border-left: 6px solid var(--accent-error);
    box-shadow: var(--shadow-brutal-sm);
}

.alert-error .icon {
    width: 28px;
    height: 28px;
    color: var(--accent-error);
    flex-shrink: 0;
}

.alert-error .message {
    color: var(--accent-error);
    font-size: 15px;
    font-family: 'JetBrains Mono', monospace;
}

/* ===== Empty State ===== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    color: var(--text-muted);
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 10px,
        rgba(0,0,0,0.02) 10px,
        rgba(0,0,0,0.02) 20px
    );
}

.empty-state .icon {
    width: 40px;
    height: 40px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 14px;
    font-style: italic;
    margin: 0;
}

/* ===== Category Sections ===== */
.category-server {
    border-left: none;
}

.category-page {
    border-left: none;
}

.category-domain {
    border-left: none;
}

/* ===== Logo & Branding ===== */
.logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 42px;
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: -1px;
    position: relative;
}

.logo-text::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 0;
    right: 0;
    height: 8px;
    background: var(--accent-primary);
    opacity: 0.3;
    z-index: -1;
}

.logo-subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-top: 8px;
}

/* ===== Results Container ===== */
.results-container {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.result-section {
    overflow: hidden;
}

.result-content {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--bg-card);
}

/* ===== Thumbnail Images ===== */
.thumbnail {
    max-width: 100px;
    max-height: 70px;
    object-fit: cover;
    border: var(--border-medium);
    filter: grayscale(30%);
    transition: filter var(--transition-fast);
}

.thumbnail:hover {
    filter: grayscale(0%);
}

/* ===== Scrollbar Styling ===== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border: 2px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ===== Utilities ===== */
.text-accent {
    color: var(--accent-primary);
}

.font-mono {
    font-family: 'JetBrains Mono', monospace;
}

.font-display {
    font-family: 'Playfair Display', serif;
}

.hidden {
    display: none !important;
}

/* Decorative rule */
.rule {
    height: 3px;
    background: var(--text-primary);
    margin: 24px 0;
}

.rule-accent {
    height: 3px;
    background: var(--accent-primary);
    margin: 24px 0;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .date-card-modern {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
    }

    .date-card-modern .date-value {
        font-size: 14px;
    }

    .logo-text {
        font-size: 32px;
    }

    .section-header h3 {
        font-size: 14px;
        letter-spacing: 1px;
    }
}

/* ===== Print Styles ===== */
@media print {
    body {
        background: white;
    }

    .glass-card {
        box-shadow: none;
        border: 1px solid #000;
    }
}
