:root {
    --bg-color: #0f172a;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #0ea5e9;
    --success: #10b981;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(139, 92, 246, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(14, 165, 233, 0.15), transparent 25%);
    background-attachment: fixed;
}

.container {
    width: 100%;
    max-width: 900px;
    padding: 2rem;
}

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

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

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

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

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    margin-bottom: 3rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    width: 16.6%;
    transition: width 0.4s ease;
}

.step {
    display: none;
    animation: fadeIn 0.5s ease;
}

.step.active {
    display: block;
}

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

h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 600;
}

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

.option-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.option-card:hover {
    transform: translateY(-8px);
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.15);
}

.option-card input[type="radio"] {
    display: none;
}

.option-card:has(input:checked) {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--primary);
    box-shadow: 0 0 25px rgba(139, 92, 246, 0.2) inset;
    transform: scale(1.02);
}

.option-card .icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.option-card .title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.option-card .desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    align-items: center;
}

button {
    padding: 0.9rem 2.2rem;
    border: none;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#prev-btn, .btn-secondary {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--card-border);
}

#prev-btn:hover, .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

#next-btn, #submit-btn, .btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

#next-btn:hover, #submit-btn:hover, .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5);
}

.hidden {
    display: none !important;
}

#result-section {
    text-align: center;
    animation: fadeIn 0.6s ease;
    width: 100%;
}

#results-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
}

.result-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: all 0.3s ease;
}

.result-card.top-1 {
    border-color: var(--primary);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(139, 92, 246, 0.2);
    transform: scale(1.02);
}

.result-card.top-1 .badge {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #000;
    font-weight: bold;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.result-card.top-2, .result-card.top-3 {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    text-align: left;
    padding: 1.5rem;
}

.result-card.top-2 .badge { background: #94a3b8; color: #000; padding: 0.2rem 0.8rem; border-radius: 12px; font-size: 0.8rem; font-weight:bold; }
.result-card.top-3 .badge { background: #b45309; color: #fff; padding: 0.2rem 0.8rem; border-radius: 12px; font-size: 0.8rem; font-weight:bold; }


.result-card img {
    width: 120px;
    height: 120px;
    margin-bottom: 1rem;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(255,255,255,0.15));
}

.result-card.top-2 img, .result-card.top-3 img {
    width: 60px;
    height: 60px;
    margin: 0;
}

.result-card.top-compact {
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
}

.result-card.top-compact img {
    width: 45px;
    height: 45px;
    margin: 0;
}

.result-card.top-compact .badge {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: bold;
}

.result-card.top-compact h3 {
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
}

.result-card.top-compact p {
    font-size: 0.85rem;
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 350px;
}

.result-card.top-compact .distro-tags {
    display: none; /* Hide tags in compact view to save space */
}

.result-controls {
    text-align: center;
    margin-bottom: 1.5rem;
}

.result-controls select {
    background: var(--card-bg);
    color: var(--text-main);
    border: 1px solid var(--card-border);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    cursor: pointer;
    margin-left: 0.5rem;
}

.result-controls select option {
    background: var(--bg-color);
}

.result-card .info-wrap {
    flex-grow: 1;
}

.result-card h3 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.result-card.top-2 h3, .result-card.top-3 h3 {
    font-size: 1.4rem;
}

.result-card p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.result-card.top-2 p, .result-card.top-3 p {
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
}

.distro-tags {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.result-card.top-2 .distro-tags, .result-card.top-3 .distro-tags {
    justify-content: flex-start;
    margin-bottom: 0;
}

.distro-tags span {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.distro-score {
    color: var(--success);
    font-weight: bold;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    display: block;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    .result-card.top-2, .result-card.top-3 {
        flex-direction: column;
        text-align: center;
    }
    .result-card.top-2 .distro-tags, .result-card.top-3 .distro-tags {
        justify-content: center;
        margin-bottom: 1rem;
    }
}
