:root {
    --primary: #F75440;
    --primary-glow: rgba(247, 84, 64, 0.4);
    --bg: #0A0A08;
    --surface: #141411;
    --surface-light: #1C1C18;
    --border: rgba(255, 255, 255, 0.08);
    --t-primary: #FAFAFA;
    --t-secondary: #A8A8A0;
    --t-dim: #5A5A52;
    --ok: #4CAF50;
    --err: #F75440;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg);
    color: var(--t-primary);
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

.app-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dot {
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 15px var(--primary-glow);
}

.brand {
    font-weight: 700;
    letter-spacing: 0.15em;
    font-size: 0.9rem;
}

.status-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.4rem 0.8rem;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--t-secondary);
}

/* Hero */
.hero {
    text-align: center;
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
}

.hero p {
    color: var(--t-secondary);
    max-width: 500px;
    margin: 0 auto;
}

/* Upload Zone */
.upload-section {
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 4rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 3rem;
}

.upload-section:hover {
    border-color: var(--primary);
    background: rgba(247, 84, 64, 0.02);
}

.upload-icon {
    width: 56px;
    height: 56px;
    background: rgba(247, 84, 64, 0.1);
    color: var(--primary);
    padding: 12px;
    border-radius: 14px;
    margin: 0 auto 1.5rem;
}

.upload-section h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.upload-section p {
    font-size: 0.85rem;
    color: var(--t-dim);
}

/* Results */
.hidden { display: none !important; }

/* Image Grid Item Formatting */
.image-grid-item {
    padding: 0;
    overflow: hidden;
    background: transparent;
    border: none;
    box-shadow: none;
}
.image-grid-item img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 24px rgba(0,0,0,0.4);
    object-fit: contain;
    display: block;
    max-height: 80vh;
}

.summary-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

.card-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--t-dim);
}

.auth-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.card-footer {
    font-size: 0.75rem;
    color: var(--t-secondary);
}

/* Specific Card States */
.verified { color: var(--ok); }
.unverified { color: var(--err); }
.trusted { color: var(--ok); }
.untrusted { color: var(--err); }

/* Details Grid (Masonry Layout) */
.details-grid {
    column-count: 1;
    column-gap: 1.5rem;
    margin-bottom: 2rem;
}
@media (min-width: 700px) {
    .details-grid {
        column-count: 2;
    }
}

.s-tag {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.s-tag::after {
    content: '';
    height: 1px;
    flex: 1;
    background: rgba(247, 84, 64, 0.2);
}

.detail-group {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    break-inside: avoid;
    margin-bottom: 1.5rem;
}

.data-table {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.data-row {
    display: flex;
    justify-content: space-between;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.data-row:last-child { border-bottom: none; }

.label {
    font-size: 0.8rem;
    color: var(--t-secondary);
}

.value {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--t-primary);
    text-align: right;
}

/* Map */
#map-container {
    height: 200px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    position: relative;
}

#map-container.fullscreen {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    height: 90vh;
    z-index: 3000;
    box-shadow: 0 0 0 100vw rgba(10, 10, 8, 0.9);
}

.map-enlarge-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 1000;
    background: rgba(0,0,0,0.6);
    color: var(--t-primary);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.map-enlarge-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
}

#map { height: 100%; width: 100%; background: #000; }

/* Raw JSON */
.raw-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

pre {
    font-family: 'Mono', monospace;
    font-size: 0.75rem;
    color: var(--t-secondary);
    background: #000;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    max-height: 400px;
}

/* Loader */
.screen-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 8, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(247, 84, 64, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1.5rem;
}

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

.mt-4 { margin-top: 1rem; }

/* Progress Bars and Metrics */
.progress-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 4px;
}
.progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
}
.score-row {
    display: flex;
    flex-direction: column;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    margin-bottom: 0.5rem;
}
.score-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}
.score-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
}
.score-label { color: var(--t-secondary); }
.score-val { color: var(--t-primary); font-weight: 500;}

/* Timeline */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    padding-left: 1rem;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    margin-top: 0.5rem;
}
.timeline-item {
    position: relative;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.35rem;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary-glow);
}
.timeline-time {
    font-size: 0.7rem;
    color: var(--t-dim);
}
.timeline-action {
    font-size: 0.85rem;
    color: var(--t-primary);
    font-weight: 500;
}
.timeline-agent {
    font-size: 0.75rem;
    color: var(--t-secondary);
}

/* Badges */
.badge {
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}
.badge.safe { background: rgba(76, 175, 80, 0.15); color: var(--ok); }
.badge.warn { background: rgba(247, 84, 64, 0.15); color: var(--err); }
