:root {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --accent: #3b82f6;
    --border: #333;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    height: 100vh;
    overflow-x: hidden;
}

/* --- Drag & Drop Overlay --- */
#drop-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 4px dashed var(--accent);
    box-sizing: border-box;
    /* Important: Start hidden and let JS toggle opacity/pointer-events */
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s, background-color 0.2s, border-color 0.2s;
}

#drop-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.overlay-content h1 {
    font-size: 3rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    pointer-events: none; /* Prevents flickering when dragging over text */
}

/* --- Main Layout --- */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#upload-prompt {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 2px dashed var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.3s;
}

#upload-prompt:hover {
    border-color: var(--accent);
}

#upload-prompt h1 { margin-bottom: 10px; }
#upload-prompt p { color: var(--text-muted); }

/* --- Search Section --- */
.hidden { display: none !important; }

.search-wrapper {
    position: sticky;
    top: 0;
    background: var(--bg-color);
    padding: 20px 0;
    z-index: 10;
    border-bottom: 1px solid var(--border);
}

#search-input {
    width: 100%;
    padding: 16px;
    font-size: 1.2rem;
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 8px;
    color: white;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

#record-count {
    text-align: right;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 8px;
}

/* --- Result Cards --- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 16px;
    padding: 20px;
    animation: fadeIn 0.2s ease-out;
}

/* The Top 3 Metrics Group */
.priority-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
}

.metric {
    display: flex;
    flex-direction: column;
}

.metric label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.metric span {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent);
    font-family: 'Courier New', monospace; /* Monospaced for numbers */
}

/* The "Other Info" Grid */
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.detail-item {
    font-size: 0.9rem;
}

.detail-item strong {
    color: var(--text-muted);
    margin-right: 6px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Validation Animations --- */

/* Valid Drop State (Green Pulse) */
#drop-overlay.valid-drag {
    border-color: #22c55e; /* Green */
    background: rgba(34, 197, 94, 0.15); /* Subtle green tint */
}

#drop-overlay.valid-drag .overlay-content h1 {
    color: #22c55e;
    animation: pulse 1.5s infinite;
}

/* Invalid Drop State (Red Shake) */
#drop-overlay.invalid-drag {
    border-color: #ef4444; /* Red */
    background: rgba(239, 68, 68, 0.15); /* Subtle red tint */
    cursor: not-allowed;
}

#drop-overlay.invalid-drag .overlay-content h1 {
    color: #ef4444;
    text-decoration: line-through; /* Cross out the text */
}

#drop-overlay.invalid-drag .overlay-content {
    animation: shake 0.5s ease-in-out;
}

/* Keyframes */
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    50% { transform: translateX(10px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}