:root {
    --bg-dark: #0f172a;
    --bg-panel: rgba(30, 41, 59, 0.7);
    --primary: #10b981;
    --primary-glow: rgba(16, 185, 129, 0.4);
    --secondary: #34d399;
    --accent: #059669;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.08);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Background Effects */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background-image: url('bg.jpg');
    background-size: 100% 100%;
    background-position: center;
    background-attachment: fixed;
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.5;
}

.glow-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, rgba(15, 23, 42, 0) 70%);
}

.glow-2 {
    bottom: -20%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(52, 211, 153, 0.1) 0%, rgba(15, 23, 42, 0) 70%);
}

/* Typography */
h1, h2, h3 {
    font-family: var(--font-heading);
    font-weight: 700;
}

.accent {
    color: var(--primary);
    text-shadow: 0 0 15px var(--primary-glow);
}

/* Container */
.app-container {
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* Glass Panels */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-panel.hidden, #upload-section.hidden {
    display: none;
    opacity: 0;
    transform: translateY(20px);
}

.glass-panel.active, #upload-section.active {
    display: block;
    animation: slideUpFade 0.6s ease forwards;
}

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

/* Hero Section */
#upload-section header {
    text-align: center;
    margin-bottom: 3rem;
}

#upload-section h1 {
    font-size: 3.5rem;
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
}

#upload-section p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed rgba(16, 185, 129, 0.3);
    border-radius: 16px;
    height: 350px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.4);
    transition: all 0.3s ease;
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(16, 185, 129, 0.05);
    transform: scale(1.02);
}

.upload-content {
    text-align: center;
    transition: opacity 0.3s;
}

.icon-large {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 10px var(--primary-glow));
}

.upload-content h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.upload-content p {
    color: var(--text-muted);
}

/* Scanning Animation */
.scanning-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.scanning-overlay.hidden {
    display: none;
}

.scanner-laser {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary);
    box-shadow: 0 0 15px var(--primary), 0 0 30px var(--primary);
    animation: scan 2s linear infinite alternate;
}

@keyframes scan {
    0% { top: 0; }
    100% { top: 100%; }
}

.scanner-text {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--primary);
    letter-spacing: 2px;
    animation: pulseText 1.5s ease-in-out infinite alternate;
}

@keyframes pulseText {
    from { opacity: 0.6; text-shadow: 0 0 5px var(--primary-glow); }
    to { opacity: 1; text-shadow: 0 0 15px var(--primary-glow), 0 0 30px var(--primary); }
}

/* Dashboard Section */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.dashboard-header h2 {
    font-size: 2rem;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-muted);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 1.5rem;
}

.card {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
}

/* Preview Card */
.preview-card {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
}

.image-wrapper {
    flex: 1;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background: #000;
    min-height: 300px;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(16, 185, 129, 0.5);
    box-shadow: 0 0 10px var(--primary);
    animation: scanSlow 4s linear infinite alternate;
}

@keyframes scanSlow {
    0% { top: 0; }
    100% { top: 100%; }
}

/* Info Card */
.info-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.species-header h3 {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.snake-name {
    font-size: 2.2rem;
    color: var(--primary);
    margin-bottom: 0.2rem;
}

.scientific-name {
    font-style: italic;
    color: var(--text-muted);
}

/* Confidence Gauge */
.confidence-gauge {
    position: relative;
    width: 100%;
    max-width: 200px;
    margin: 2rem auto 0;
}

.gauge-svg {
    width: 100%;
    height: auto;
    transform: scale(1.1);
}

.gauge-bg {
    stroke: rgba(255, 255, 255, 0.05);
}

.gauge-fill {
    stroke: var(--primary);
    filter: drop-shadow(0 0 5px var(--primary));
    transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.gauge-text {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.score {
    font-size: 2.5rem;
    font-weight: 800;
    font-family: var(--font-heading);
}

.percent {
    font-size: 1.2rem;
    color: var(--primary);
}

.gauge-text .label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Map Card */
.map-card h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--text-main);
}

.map-container {
    height: 150px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background: #0b1121;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.mock-map {
    width: 100%;
    height: 100%;
    background-image: radial-gradient(rgba(16, 185, 129, 0.1) 1px, transparent 1px);
    background-size: 15px 15px;
    position: relative;
}

.map-marker {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
}

.glow-pulse {
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.map-zone {
    position: absolute;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
}

/* Details Card */
.details-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}

.detail-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-row .label {
    color: var(--text-muted);
}

.detail-row .value {
    font-weight: 600;
}

.value.safe {
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Responsive */
@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .preview-card {
        grid-column: 1;
        grid-row: auto;
        height: 300px;
    }
}

@media (max-width: 600px) {
    #upload-section h1 {
        font-size: 2.5rem;
    }
    .glass-panel {
        padding: 1.5rem;
    }
}
