:root {
    --primary-color: #6366f1;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --bg-color: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: rgba(226, 232, 240, 0.5);
    --success-color: #10b981;
    --shadow-soft: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --glass-blur: blur(12px);
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #0f172a;
        --card-bg: rgba(30, 41, 59, 0.7);
        --glass-border: rgba(255, 255, 255, 0.1);
        --text-main: #f1f5f9;
        --text-muted: #94a3b8;
        --border-color: rgba(51, 65, 85, 0.5);
        --shadow-soft: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    background-image:
        radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-x: hidden;
}

/* Background Animation */
.bg-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    width: 400px;
    height: 400px;
    background: var(--primary-color);
    filter: blur(80px);
    opacity: 0.15;
    border-radius: 50%;
    animation: move 25s infinite alternate;
}

.blob-1 {
    top: -100px;
    left: -100px;
    background: #6366f1;
    animation-delay: 0s;
}

.blob-2 {
    bottom: -100px;
    right: -100px;
    background: #a855f7;
    animation-delay: -5s;
}

.blob-3 {
    top: 40%;
    left: 30%;
    background: #ec4899;
    animation-delay: -10s;
}

@keyframes move {
    from {
        transform: translate(0, 0) scale(1);
    }

    to {
        transform: translate(100px, 100px) scale(1.2);
    }
}

body.rtl {
    direction: rtl;
    text-align: right;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
    z-index: 1;
    display: flex;
    flex-direction: column;
}

header {
    position: sticky;
    top: 20px;
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-soft);
    z-index: 100;
}

.app-version {
    position: absolute;
    top: 8px;
    right: 20px;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

body.rtl .app-version {
    right: auto;
    left: 20px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.header-title h1 {
    font-size: 1.75rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.header-title p {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: -2px;
}

.lang-switch {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    padding: 10px 18px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    color: var(--text-main);
    backdrop-filter: var(--glass-blur);
    transition: var(--transition);
}

.lang-switch:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.progress-container {
    width: 100%;
    margin-top: 15px;
}

.progress-bar {
    height: 10px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 5px;
    overflow: hidden;
}

@media (prefers-color-scheme: dark) {
    .progress-bar {
        background: rgba(255, 255, 255, 0.1);
    }
}

.progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    width: 0%;
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-radius: 5px;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    padding: 40px;
    border-radius: 24px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 24px;
    transition: var(--transition);
    border: 1px solid var(--glass-border);
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.item-name {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--primary-color);
    letter-spacing: -0.01em;
}

.item-question {
    font-size: 1.15rem;
    font-weight: 500;
    margin-bottom: 30px;
    color: var(--text-main);
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.option-btn {
    display: flex;
    align-items: center;
    padding: 18px 24px;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

body.rtl .option-btn {
    text-align: right;
}

.option-btn:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
    transform: scale(1.01) translateX(5px);
}

body.rtl .option-btn:hover {
    transform: scale(1.01) translateX(-5px);
}

.option-btn.selected {
    border-color: var(--primary-color);
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.2);
}

.option-value {
    font-weight: 800;
    font-size: 1.25rem;
    margin: 0 15px;
    min-width: 30px;
    opacity: 0.8;
}

.nav-buttons {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 10px;
}

.btn {
    padding: 14px 28px;
    border-radius: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

@media (prefers-color-scheme: dark) {
    .btn-secondary {
        background: rgba(255, 255, 255, 0.05);
    }
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
    .btn-secondary:hover {
        background: rgba(255, 255, 255, 0.1);
    }
}

.btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none !important;
}

/* Intro View */
.intro-content h2 {
    font-size: 2rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 24px;
}

.intro-content p {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.intro-content h3 {
    margin: 30px 0 15px;
    font-size: 1.2rem;
    font-weight: 700;
}

.intro-content ul {
    margin-bottom: 40px;
    padding-inline-start: 25px;
}

.intro-content li {
    margin-bottom: 12px;
}

/* Summary View */
.summary-header {
    text-align: center;
    margin-bottom: 45px;
}

.score-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 4px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    position: relative;
    box-shadow: var(--shadow-soft);
}

.score-circle::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 4px solid var(--primary-color);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    /* Update this in JS if you want dynamic progress */
}

.score-value {
    font-size: 3rem;
    font-weight: 900;
    line-height: 1;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.score-max {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.interpretation-card {
    background: rgba(99, 102, 241, 0.05);
    border-left: 6px solid var(--primary-color);
    padding: 25px;
    border-radius: 16px;
    margin-bottom: 35px;
}

body.rtl .interpretation-card {
    border-left: none;
    border-right: 6px solid var(--primary-color);
}

.breakdown-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 35px;
}

.breakdown-table th {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.breakdown-table th,
.breakdown-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

body.rtl .breakdown-table th,
body.rtl .breakdown-table td {
    text-align: right;
}

.actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 40px;
}

footer {
    text-align: center;
    margin-top: 60px;
    margin-bottom: 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

@media (max-width: 650px) {
    body {
        padding: 15px;
    }

    header {
        padding: 15px 20px;
        top: 10px;
    }

    .card {
        padding: 25px;
    }

    .header-title h1 {
        font-size: 1.4rem;
    }

    .option-btn {
        padding: 14px 18px;
        font-size: 0.95rem;
    }

    .intro-content h2 {
        font-size: 1.6rem;
    }
}