:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --bg-color: #0f172a;
    --panel-bg: rgba(30, 41, 59, 0.7);
    --panel-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
    --danger: #ef4444;
    --input-bg: rgba(15, 23, 42, 0.6);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    position: relative;
    overflow-x: hidden;
}

/* Background Animations */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    filter: blur(80px);
    border-radius: 50%;
    opacity: 0.5;
    animation: float 10s infinite alternate ease-in-out;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, #3b82f680 0%, transparent 70%);
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, #8b5cf680 0%, transparent 70%);
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(30px) scale(1.1); }
}

/* Main Container */
.container {
    max-width: 900px;
    width: 100%;
    z-index: 1;
}

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

header h1 {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
}

header h1 span {
    color: var(--primary-color);
    background: linear-gradient(135deg, #60a5fa, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

/* Glass Panel */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.forms-wrapper {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .forms-wrapper {
        flex-direction: column;
    }
}

.form-section {
    flex: 1;
}

.form-section h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #e2e8f0;
}

.divider {
    width: 1px;
    background: var(--panel-border);
}

@media (max-width: 768px) {
    .divider {
        width: 100%;
        height: 1px;
        margin: 1rem 0;
    }
}

/* Inputs */
.input-group {
    margin-bottom: 1.25rem;
}

.input-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.input-group input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s ease;
}

.input-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Button */
.primary-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 12px;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.39);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.primary-btn:active {
    transform: translateY(0);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.6rem;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.secondary-btn.danger-style:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

/* Results Area */
.result-area {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--panel-border);
    animation: slideDown 0.4s ease-out forwards;
}

.result-area.hidden {
    display: none;
}

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

.status-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 1rem;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
}

.status-badge.success {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.status-badge.error {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.details-list {
    list-style: none;
    margin-bottom: 2rem;
}

.details-list li {
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.eval-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 1.25rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.eval-ok {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
}
.eval-warn {
    background: rgba(245, 158, 11, 0.05);
    border: 1px solid rgba(245, 158, 11, 0.2);
}
.eval-danger {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.issue-main {
    font-weight: 700;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.eval-ok .issue-main { color: #6ee7b7; }
.eval-warn .issue-main { color: #fcd34d; }
.eval-danger .issue-main { color: #fca5a5; }

.eval-icon {
    font-size: 1.3rem;
    line-height: 1;
}

.eval-label {
    display: inline-block;
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: rgba(255,255,255,0.1);
    color: #e2e8f0;
    margin-left: 0.5rem;
    font-weight: normal;
}

.issue-advice {
    color: #e2e8f0;
    font-size: 0.9rem;
    padding-left: 1.7rem;
}

.issue-solution {
    color: #34d399;
    font-size: 0.9rem;
    margin-left: 1.7rem;
    background: rgba(16, 185, 129, 0.1);
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    width: calc(100% - 1.7rem);
    border-left: 3px solid #34d399;
}

.ideal-geometry {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 1.5rem;
}

.fit-visualization {
    margin-top: 1.5rem;
    padding: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.7);
}

.fit-visualization h4 {
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
    color: #cbd5e1;
}

#fit-canvas {
    width: 100%;
    height: auto;
    border-radius: 10px;
    background: rgba(8, 16, 31, 0.85);
    box-shadow: inset 0 0 12px rgba(0,0,0,0.35);
    display: block;
    margin-top: 0.4rem;
    margin-bottom: 0.75rem;
}

.fit-legend {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    color: #a8b5cc;
    font-size: 0.9rem;
}

.legend-color {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 0.35rem;
    border-radius: 3px;
}

.legend-color.bike-frame { background: #60a5fa; }
.legend-color.ideal { background: #34d399; }
.legend-color.actual { background: #fbbf24; }

.ideal-geometry h4 {
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

.stat-box {
    text-align: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.stat-box.primary-stat {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
    transition: transform 0.2s ease;
}

.stat-box.primary-stat:hover {
    transform: translateY(-2px);
}

.stat-box .label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.stat-box .value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}
