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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(-45deg, #0b1120, #0f172a, #1e1b4b, #064e3b, #1e293b);
    background-size: 400% 400%;
    animation: gradientBG 20s ease infinite;
    background-attachment: fixed;
    color: #f1f5f9;
    line-height: 1.6;
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Background Particles */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: rgba(96, 165, 250, 0.2);
    border-radius: 50%;
    animation: float 20s infinite ease-in-out alternate;
}

.particle:nth-child(1) {
    top: 20%;
    left: 10%;
    animation-duration: 25s;
    filter: blur(2px);
}

.particle:nth-child(2) {
    top: 60%;
    left: 80%;
    width: 12px;
    height: 12px;
    animation-duration: 30s;
    filter: blur(4px);
}

.particle:nth-child(3) {
    top: 40%;
    left: 40%;
    animation-duration: 20s;
}

.particle:nth-child(4) {
    top: 80%;
    left: 20%;
    width: 15px;
    height: 15px;
    background: rgba(167, 139, 250, 0.15);
    animation-duration: 35s;
    filter: blur(6px);
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(100px, -100px) scale(1.5);
    }
}

.dashboard {
    max-width: 1400px;
    width: 100%;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-area h1 {
    font-weight: 700;
    font-size: 1.7rem;
    letter-spacing: -0.02em;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-area .badge {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    margin-top: 0.8rem;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-tags span {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.upload-section {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 20px;
    padding: 4.5rem 3rem;
    margin-bottom: 3.5rem;
    text-align: center;
    border: 1px solid rgba(148, 163, 184, 0.1);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(59, 130, 246, 0.05);
}

.upload-section.dragover {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
}

.upload-icon {
    font-size: 3.8rem;
    color: #3b82f6;
    margin-bottom: 1.5rem;
    opacity: 0.8;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.upload-section:hover .upload-icon {
    opacity: 1;
    transform: translateY(-4px) scale(1.05);
    filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.4));
}

.upload-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #f8fafc;
    letter-spacing: -0.01em;
}

.upload-sub {
    color: #94a3b8;
    font-size: 1rem;
    margin: 1rem 0 2.5rem 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.upload-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.upload-label {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    font-weight: 500;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    box-shadow: 0 4px 15px -3px rgba(59, 130, 246, 0.5);
    transition: all 0.2s ease-in-out;
}

.upload-label:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px -3px rgba(59, 130, 246, 0.6);
}

#fileUpload {
    display: none;
}

.reset-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #cbd5e1;
    font-weight: 500;
    padding: 0.8rem 1.8rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.reset-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
}

.file-info {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: #94a3b8;
    background: rgba(0, 0, 0, 0.2);
    display: inline-block;
    padding: 0.4rem 1.2rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.error-message {
    color: #fca5a5;
    background: rgba(153, 27, 27, 0.2);
    border-radius: 8px;
    padding: 0.8rem 1.5rem;
    margin-top: 1rem;
    display: inline-block;
    font-weight: 500;
    border: 1px solid rgba(248, 113, 113, 0.3);
    font-size: 0.95rem;
}

.progress-bar {
    width: 50%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin: 1.2rem auto 0;
    overflow: hidden;
    display: none;
}

.progress-fill {
    height: 100%;
    background: #3b82f6;
    width: 0%;
    transition: width 0.2s ease-out;
}

.data-dashboard {
    display: none;
    animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.kpi-card {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 2rem 1.8rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.kpi-card:hover {
    transform: translateY(-4px) scale(1.02);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 15px 50px -10px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.kpi-icon {
    font-size: 1.6rem;
    color: #60a5fa;
    margin-bottom: 1.5rem;
    background: rgba(59, 130, 246, 0.08);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.kpi-label {
    font-size: 0.85rem;
    color: #94a3b8;
    font-weight: 500;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.kpi-trend {
    font-size: 0.8rem;
    color: #10b981;
    font-weight: 500;
    margin-top: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.chart-container {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.chart-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

canvas {
    max-height: 250px;
    width: 100% !important;
}

.stats-panel {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
    margin: 2.5rem 0;
}

.insight-box,
.table-preview {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.insight-title {
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.insight-list {
    list-style: none;
}

.insight-list li {
    display: flex;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.95rem;
    color: #cbd5e1;
}

.insight-list li:last-child {
    border: none;
}

.insight-list li strong {
    color: #ffffff;
    font-weight: 600;
}

.table-preview table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table-preview th {
    text-align: left;
    padding: 1rem;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.table-preview th:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.table-preview th:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.table-preview td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    position: relative;
    z-index: 1;
}

.table-preview tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.data-bar-bg {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    height: 70%;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 4px;
    z-index: -1;
    pointer-events: none;
}

.data-bar-fill {
    height: 100%;
    background: rgba(59, 130, 246, 0.5);
    border-radius: 4px;
    transition: width 0.5s ease-out;
}

.text-green-500 {
    color: #22c55e !important;
    font-weight: 600;
}

.text-red-500 {
    color: #ef4444 !important;
    font-weight: 600;
}

/* Leaflet Override */
.leaflet-container {
    background: #0f172a !important;
    font-family: inherit;
}

.leaflet-popup-content-wrapper {
    background: rgba(15, 23, 42, 0.9) !important;
    color: #f1f5f9 !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    border-radius: 8px !important;
}

.leaflet-popup-tip {
    background: rgba(15, 23, 42, 0.9) !important;
}

.ml-section {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 20px;
    padding: 3rem;
    margin: 2.5rem 0;
    border: 1px solid rgba(59, 130, 246, 0.15);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(59, 130, 246, 0.1);
}

.ml-header {
    margin-bottom: 1.5rem;
}

.ml-header h2 {
    font-weight: 600;
    font-size: 1.4rem;
    color: #ffffff;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.predict-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
    background: rgba(0, 0, 0, 0.2);
    padding: 1.8rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.input-group label {
    font-weight: 500;
    font-size: 0.85rem;
    color: #94a3b8;
}

.input-group input,
.input-group select {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.8rem;
    font-family: inherit;
    font-size: 0.95rem;
    color: #ffffff;
    transition: all 0.2s ease;
}

.input-group input:focus,
.input-group select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    outline: none;
}

.predict-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    font-weight: 600;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    align-self: flex-end;
    transition: all 0.2s ease;
    height: 45px;
    box-shadow: 0 4px 15px -3px rgba(16, 185, 129, 0.4);
}

.predict-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px -3px rgba(16, 185, 129, 0.6);
}

.result-box {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border-left: 4px solid #475569;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.result-text {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.result-icon i {
    font-size: 1.8rem;
    margin-top: 0.2rem;
}

.result-main {
    font-weight: 600;
    font-size: 1.1rem;
    color: #ffffff;
    margin-bottom: 0.2rem;
}

.result-desc {
    font-size: 0.9rem;
    color: #94a3b8;
}

.chip {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 500;
    color: #e2e8f0;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

footer {
    margin-top: 4rem;
    color: #64748b;
    font-size: 0.85rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    width: 100%;
}

/* Scrollbar styling for dark mode */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0f172a;
}

::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}