/* CSS: style.css */
:root {
    --bg-color: #020617;
    --card-bg: rgba(255, 255, 255, 0.06);
    --card-bg-hover: rgba(255, 255, 255, 0.08);
    --border-color: rgba(255, 255, 255, 0.10);
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --accent-1: #4F46E5;
    --accent-2: #D946EF;
    --accent-3: #FBBF24;
    --success: #22C55E;
    --error: #FF8C94;
    --font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --gradient-cta: linear-gradient(135deg, #4F46E5 0%, #D946EF 100%);
    --nebula-bg: radial-gradient(circle at 10% 10%, rgba(79, 70, 229, 0.25) 0%, transparent 50%), 
                 radial-gradient(circle at 90% 90%, rgba(217, 70, 239, 0.20) 0%, transparent 50%), 
                 radial-gradient(circle at 50% 50%, rgba(79, 70, 229, 0.05) 0%, transparent 80%),
                 #020617;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--nebula-bg);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-family);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px;
}

/* Stars Background */
.stars-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0.3;
    animation: twinkle var(--duration) infinite ease-in-out;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.2; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.2); }
}

.app-header {
    text-align: center;
    margin-bottom: 40px;
}

.exclusivity-badge {
    display: inline-block;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: var(--accent-3);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    padding: 4px 12px;
    border-radius: 100px;
    margin-bottom: 12px;
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.1);
}

.app-header h1 {
    font-size: clamp(22px, 5vw, 32px);
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.app-header p {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 24px;
}

.header-personalization {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.top-name-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 20px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
    text-align: center;
    outline: none;
    transition: all 0.3s ease;
    width: 200px;
}

.top-name-input:focus {
    border-color: var(--accent-1);
    background: rgba(255, 255, 255, 0.08);
    width: 240px;
    box-shadow: 0 0 15px rgba(79, 70, 229, 0.2);
}

.app-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

/* Card Styling */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease, border-color 0.2s ease;
}

.card:hover {
    background: var(--card-bg-hover);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Sliders */
.sliders-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.slider-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.slider-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.slider-label {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.slider-value {
    background: rgba(255, 255, 255, 0.10);
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 800;
    color: var(--accent-3);
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.10);
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #F1F5F9;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    transition: transform 0.1s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #F1F5F9;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Custom background for the "selected" part of the track */
input[type="range"]::-moz-range-progress {
    background-color: var(--accent-1);
    height: 6px;
    border-radius: 3px;
}

/* Radar Chart Enhancements */
#radar-chart polygon {
    filter: drop-shadow(0 0 8px rgba(217, 70, 229, 0.3));
}

.radar-dot {
    transition: r 0.2s ease, fill 0.2s ease;
}

.radar-dot:hover {
    r: 6;
    fill: var(--accent-3);
    cursor: pointer;
}

/* Wheel Container */
.wheel-container {
    width: 100%;
    aspect-ratio: 1/1;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 24px;
    position: relative; /* Base for labels */
}

.labels-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Let clicks pass to wheel or sliders */
}

.label-badge {
    position: absolute;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 6px 12px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    pointer-events: auto; /* Enable hover */
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease, border-color 0.2s ease;
    z-index: 10;
}

.label-badge:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%) scale(1.05);
}

.label-emoji {
    font-size: 16px;
    margin-bottom: 2px;
}

.label-text {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Print Mode for Labels */
.export-mode .label-badge {
    background: #ffffff !important;
    border: 1px solid #000000 !important;
    backdrop-filter: none !important;
}

.export-mode .label-text {
    color: #000000 !important;
}

#radar-chart {
    width: 100%;
    height: 100%;
    max-width: 450px;
    overflow: visible;
}

#radar-chart .main-polygon {
    filter: drop-shadow(0 0 10px rgba(217, 70, 229, 0.4));
    animation: auraPulse 4s infinite ease-in-out;
    transition: fill 0.8s ease, stroke 0.8s ease;
}

@keyframes auraPulse {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(217, 70, 229, 0.3)); transform: scale(1); transform-origin: center; }
    50% { filter: drop-shadow(0 0 15px rgba(217, 70, 229, 0.6)); transform: scale(1.02); transform-origin: center; }
}

.ghost-polygon {
    stroke-dasharray: 4, 4;
}

.radar-dot {
    transition: r 0.2s ease, fill 0.2s ease, cx 0.3s ease, cy 0.3s ease;
}

/* Score Badge */
.score-badge-container {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.score-badge {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.15) 0%, rgba(217, 70, 239, 0.15) 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 12px 24px;
    border-radius: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.score-badge.high-alignment {
    border-color: var(--accent-3);
    box-shadow: 0 4px 25px rgba(251, 191, 36, 0.3);
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.2) 0%, rgba(251, 191, 36, 0.2) 100%);
}

.score-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.score-percent {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

/* Summary Section */
.summary-section {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.summary-item {
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
}

.summary-title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.summary-val {
    font-weight: 600;
    font-size: 15px;
}

.guidance-text {
    font-style: italic;
    color: var(--text-secondary);
    font-size: 14px;
    text-align: center;
    margin-top: 8px;
}

/* Actions */
.actions-group {
    display: flex;
    gap: 12px;
}

.btn {
    flex: 1;
    padding: 14px;
    border-radius: 12px;
    border: none;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    font-size: 15px;
}

.btn-primary {
    background: var(--gradient-cta);
    color: white;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.10);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-secondary:active {
    background: rgba(255, 255, 255, 0.10);
}

/* Intent Section */
.intent-card {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

textarea, input[type="text"] {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

textarea:focus, input[type="text"]:focus {
    border-color: var(--accent-1);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

/* Info Sections */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 24px;
}

.intro-info {
    margin-top: 0;
    margin-bottom: 40px;
}

.info-card h3 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--accent-3);
    letter-spacing: -0.01em;
}

.info-card p, .info-card ol {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.info-card ol {
    padding-left: 20px;
}

.info-card li {
    margin-bottom: 8px;
}

.info-card li::marker {
    color: var(--accent-1);
    font-weight: 800;
}

/* FAQ Section */
.faq-section {
    margin-top: 100px; /* More breathing room from the tool */
    margin-bottom: 60px;
    max-width: 720px; /* Slightly narrower for better readability */
    margin-left: auto;
    margin-right: auto;
    padding: 0 24px;
}

.section-title {
    text-align: center;
    font-size: 22px;
    margin-bottom: 48px; /* Increased from 40px */
    color: var(--text-primary);
    font-weight: 800;
    letter-spacing: -0.01em;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 20px; /* Increased from 12px for much better air */
}

.faq-item {
    padding: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.08); /* Finer border */
}

.faq-item[open] {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

.faq-item summary {
    padding: 20px 24px;
    list-style: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-primary);
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 18px;
    color: var(--accent-1);
    transition: transform 0.3s ease;
    opacity: 0.6;
}

.faq-item[open] summary::after {
    transform: rotate(45deg);
    opacity: 1;
}

.faq-content {
    padding: 4px 24px 24px 24px; /* Reduced top padding for better flow with summary */
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7; /* Extra line-height for readability */
}

/* Footer */
.app-footer {
    margin-top: 80px;
    text-align: center;
    font-size: 12px;
    opacity: 0.7;
    color: var(--text-secondary);
    padding-bottom: 40px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .app-grid {
        grid-template-columns: 1fr;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .actions-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .faq-section {
        margin-top: 40px;
    }
}
