:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #64748b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    padding: 2rem 1rem;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

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

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    margin-bottom: 0.5rem;
}

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

.prediction-card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

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

.input-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
}

.input-group input {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
    background-color: #f1f5f9;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    background-color: #ffffff;
}

.input-group small {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.form-actions {
    margin-top: 2.5rem;
    display: flex;
    gap: 1rem;
}

button {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 1rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

#submitBtn {
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    color: white;
}

#submitBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background-color: #f1f5f9;
    color: var(--text-main);
    flex: 0.4;
}

.btn-secondary:hover {
    background-color: #e2e8f0;
}

.result-card {
    margin-top: 2rem;
    padding: 2.5rem;
    border-radius: 1.5rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    animation: slideIn 0.5s ease-out;
}

.hidden {
    display: none;
}

.result-header h3 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

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

.prediction-status {
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 1rem;
}

.diabetic { color: var(--danger); }
.non-diabetic { color: var(--success); }

#predictionText {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.probability-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.progress-bar {
    height: 12px;
    background: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    transition: width 1s ease-in-out;
}

#probValue {
    font-weight: 600;
    text-align: right;
    font-size: 0.875rem;
}

.loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    display: none;
}

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

.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.tab-btn {
    flex: 0 1 auto;
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 2rem;
    font-size: 0.9rem;
}

.tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Advanced Dashboard Redesign */
.dashboard-advanced-grid {
    display: grid;
    grid-template-columns: 200px 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 1.5rem;
}

.summary-col {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.small-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    height: 100%;
}

.stat-value.highlight {
    font-size: 2rem;
    margin: 0.5rem 0;
}

.stat-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.chart-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.wide-card {
    grid-column: span 2;
}

.chart-container-large {
    position: relative;
    height: 250px;
    width: 100%;
}

.chart-container-wide {
    position: relative;
    height: 300px;
    width: 100%;
}

@media (max-width: 1024px) {
    .dashboard-advanced-grid {
        grid-template-columns: 1fr 1fr;
    }
    .summary-col {
        grid-column: span 2;
        flex-direction: row;
    }
    .summary-col > div {
        flex: 1;
    }
}

@media (max-width: 768px) {
    .dashboard-advanced-grid {
        grid-template-columns: 1fr;
    }
    .wide-card, .summary-col {
        grid-column: span 1;
    }
    .summary-col {
        flex-direction: column;
    }
}

.medical-advice {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 1rem;
    border-left: 4px solid var(--primary);
}

#adviceList {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

#adviceList li {
    font-size: 0.9rem;
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

#adviceList li::before {
    content: "•";
    color: var(--primary);
    font-weight: bold;
}

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

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .form-actions {
        flex-direction: column;
    }
    button {
        width: 100%;
    }
}
