:root {
    --primary: #10B981;
    --primary-hover: #059669;
    --secondary: #34D399;
    --danger: #EF4444;
    --bg-main: #F0FDF4;
    --panel-bg: #FFFFFF;
    --panel-border: #D1FAE5;
    --text-main: #1E293B;
    --text-muted: #475569;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

.spline-container {
    position: absolute;
    top: -150px;
    right: -120px;
    width: 380px;
    height: 380px;
    z-index: 10;
    overflow: hidden;
}

spline-viewer::part(logo) {
    display: none !important;
}

spline-viewer {
    width: 100%;
    height: calc(100% + 50px);
}

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

header {
    text-align: center;
    margin-bottom: 3rem;
}

header .logo {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 10px rgba(79, 70, 229, 0.5));
}

header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-hover);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

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

/* Solid Panel */
.panel {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(209, 250, 229, 0.5);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.15);
}

.controls-section {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.controls-section label {
    font-weight: 500;
    color: var(--text-muted);
}

.custom-select-wrapper select {
    width: 100%;
    padding: 12px 16px;
    background-color: #F8FAFC;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23475569" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 24px;
    border: 1px solid var(--panel-border);
    color: var(--text-main);
    border-radius: 12px;
    font-size: 1rem;
    line-height: 1.5;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: all 0.3s ease;
}

.custom-select-wrapper select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.custom-select-wrapper select option {
    background: white;
}

/* Info Section */
.info-section {
    background: #E6FFFA;
    border-left: 4px solid var(--primary);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}
.info-section h3 {
    color: var(--primary-hover);
    margin-bottom: 0.5rem;
}
.info-section p {
    color: var(--text-muted);
    line-height: 1.6;
}

/* Upload Zone */
.upload-section {
    border: 2px dashed var(--primary);
    border-radius: 20px;
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #F8FAFC;
}

.upload-section:hover, .upload-section.dragover {
    border-color: var(--primary-hover);
    background: #ECFDF5;
    transform: scale(1.01);
}

.upload-icon {
    font-size: 3.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.upload-section:hover .upload-icon {
    transform: translateY(-5px);
}

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

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

/* Images & Previews */
.images-container {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.image-box {
    flex: 1;
    background: #F8FAFC;
    border-radius: 16px;
    padding: 1rem;
    border: 1px solid var(--panel-border);
    text-align: center;
}

.image-box h4 {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-weight: 500;
}

.image-box img {
    max-width: 100%;
    border-radius: 12px;
    max-height: 300px;
    object-fit: contain;
}

/* Buttons */
button {
    width: 100%;
    padding: 1.2rem;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.glow-on-hover {
    background: var(--primary);
    color: white;
    position: relative;
    z-index: 0;
}

.glow-on-hover:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px var(--primary);
}

.secondary-btn {
    background: #F1F5F9;
    color: var(--text-main);
    border: 1px solid var(--panel-border);
    margin-top: 2rem;
}

.secondary-btn:hover {
    background: #E2E8F0;
}

/* Loader */
#loader {
    text-align: center;
    padding: 3rem 0;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(79, 70, 229, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem auto;
}

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

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

.badge {
    display: inline-block;
    white-space: nowrap;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.badge-normal {
    background: rgba(16, 185, 129, 0.2);
    color: #34D399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-dr {
    background: rgba(239, 68, 68, 0.2);
    color: #F87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.confidence-bars {
    margin-bottom: 3rem;
}

.bar-container {
    margin-bottom: 1.5rem;
}

.bar-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.bar-bg {
    width: 100%;
    height: 12px;
    background: #E2E8F0;
    border-radius: 6px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.normal-fill {
    background: linear-gradient(90deg, #059669, #34D399);
}

.dr-fill {
    background: linear-gradient(90deg, #DC2626, #F87171);
}

.dual-stream-view h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

footer {
    text-align: center;
    margin-top: 3rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .images-container {
        flex-direction: column;
    }
}

/* Navigation Menu */
.main-nav {
    width: 100%;
    padding: 1.5rem 3rem;
    display: flex;
    justify-content: center;
    gap: 3rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--panel-border);
    margin-bottom: 3rem;
    position: relative;
    z-index: 2;
}

.main-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.main-nav a:hover, .main-nav a.active {
    color: var(--primary-hover);
    font-weight: 600;
}

/* About Page Styles */
.about-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--panel-border);
}

.about-header h1 {
    color: var(--primary-hover);
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.about-content section {
    margin-bottom: 2rem;
}

.about-content h2 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.about-content p {
    color: var(--text-main);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.about-content ul, .about-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-main);
    line-height: 1.7;
}

.about-content li {
    margin-bottom: 0.5rem;
}

/* Table Styles */
.table-responsive {
    overflow-x: auto;
    margin-bottom: 2rem;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.95rem;
    background: #FFFFFF;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.results-table th, .results-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--panel-border);
    vertical-align: middle;
}

.results-table th {
    background-color: #F8FAFC;
    color: var(--text-muted);
    font-weight: 600;
}

.results-table tr:hover {
    background-color: #F1F5F9;
}

.thumb-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--panel-border);
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal.hidden {
    display: none !important;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {transform: scale(0.8); opacity: 0;}
    to {transform: scale(1); opacity: 1;}
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.close-modal:hover,
.close-modal:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}
