:root {
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-emerald: #10b981;
    --accent-emerald-glow: rgba(16, 185, 129, 0.25);
    --accent-indigo: #6366f1;
    --accent-purple: #a855f7;
    --input-bg: #0f172a;
    --input-border: #334155;
    --input-focus: #10b981;
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 16px;
}

.page-container {
    width: 100%;
    max-width: 650px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 24px;
}

.header-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 9999px;
    color: #a5b4fc;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(to right, #f8fafc, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Card */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
}

/* Quick Samples */
.samples-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.samples-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.sample-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    background: #1e293b;
    border: 1px solid #334155;
    color: #cbd5e1;
    font-size: 0.8rem;
    padding: 5px 12px;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-weight: 500;
}

.chip:hover {
    background: #334155;
    border-color: #475569;
    color: #fff;
    transform: translateY(-1px);
}

/* Alert */
.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 26px;
}

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

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-primary);
    padding: 12px 42px 12px 14px;
    font-size: 1rem;
    border-radius: var(--radius-md);
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrapper input:focus {
    border-color: var(--accent-emerald);
    box-shadow: 0 0 0 3px var(--accent-emerald-glow);
}

.input-wrapper .unit {
    position: absolute;
    right: 14px;
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 600;
    pointer-events: none;
}

/* Buttons */
.button-container {
    display: flex;
    gap: 12px;
}

.btn {
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
    padding: 13px 22px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    flex: 1;
    box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.39);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #334155;
    color: #cbd5e1;
}

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

/* Results */
.result-section {
    margin-top: 30px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.result-card {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: var(--radius-md);
    padding: 20px;
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.result-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.species-badge {
    padding: 6px 16px;
    border-radius: 9999px;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.species-badge.setosa {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid #10b981;
    color: #34d399;
}

.species-badge.versicolor {
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid #6366f1;
    color: #818cf8;
}

.species-badge.virginica {
    background: rgba(168, 85, 247, 0.2);
    border: 1px solid #a855f7;
    color: #c084fc;
}

/* Probabilities */
.prob-distribution h4 {
    font-size: 0.82rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.prob-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.prob-label-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: #1e293b;
    border-radius: 9999px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.6s ease-out;
}

.progress-bar-fill.setosa {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.progress-bar-fill.versicolor {
    background: linear-gradient(90deg, #6366f1, #818cf8);
}

.progress-bar-fill.virginica {
    background: linear-gradient(90deg, #a855f7, #c084fc);
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.8rem;
    color: #64748b;
}

.footer code {
    background: #1e293b;
    padding: 2px 6px;
    border-radius: 4px;
    color: #94a3b8;
    font-size: 0.78rem;
}
