/* ===== CSS Variables ===== */
:root {
    --primary-gold: #d4a574;
    --primary-gold-light: #e8c9a8;
    --primary-blue: #1e3a5f;
    --primary-blue-dark: #0f2744;
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.12);
    --success: #22c55e;
    --error: #ef4444;
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Cairo', sans-serif;
    background: url('bg.jpg') center center / cover no-repeat fixed;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: manipulation;
}

/* ===== Background Overlay ===== */
.bg-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg,
            rgba(15, 39, 68, 0.92) 0%,
            rgba(30, 58, 95, 0.88) 50%,
            rgba(15, 39, 68, 0.95) 100%);
    z-index: 1;
}

/* ===== Screen Containers ===== */
.screen {
    display: none;
    width: 100%;
    max-width: 100%;
    padding: 16px;
}

.screen.active {
    display: block;
    animation: screenFadeIn 0.4s var(--transition-smooth) forwards;
}

.screen.fade-out {
    animation: screenFadeOut 0.15s var(--transition-smooth) forwards;
}

@keyframes screenFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes screenFadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

/* ===== Glass Card ===== */
.glass-card {
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.12) 0%,
            rgba(255, 255, 255, 0.05) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    padding: 28px 24px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(0);
    transition: transform 0.3s var(--transition-smooth),
        box-shadow 0.3s var(--transition-smooth);
}

/* ===== Logo Styles ===== */
.logo-float {
    filter: drop-shadow(0 8px 24px rgba(212, 165, 116, 0.3));
}

.animate-float {
    animation: floatAnimation 1.5s ease-in-out infinite;
}

@keyframes floatAnimation {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

/* ===== Typography ===== */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-gold) 0%, var(--primary-gold-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Buttons ===== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 32px;
    background: linear-gradient(135deg, var(--primary-gold) 0%, #c9986a 100%);
    border: none;
    border-radius: 16px;
    color: white;
    font-size: 18px;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
    cursor: pointer;
    transition: all 0.3s var(--transition-smooth);
    box-shadow: 0 4px 20px rgba(212, 165, 116, 0.4);
    position: relative;
    overflow: hidden;
    touch-action: manipulation;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.2) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-primary:hover::before,
.btn-primary:active::before {
    opacity: 1;
}

.btn-primary:active {
    transform: scale(0.97);
    box-shadow: 0 2px 12px rgba(212, 165, 116, 0.3);
}

/* ===== WhatsApp Button ===== */
.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 28px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    border: none;
    border-radius: 16px;
    color: white;
    font-size: 17px;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
    cursor: pointer;
    transition: all 0.3s var(--transition-smooth);
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.35);
    text-decoration: none;
    touch-action: manipulation;
}

.btn-whatsapp:active {
    transform: scale(0.97);
}

/* ===== Progress Bar ===== */
.progress-bar {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-gold) 0%, var(--primary-gold-light) 100%);
    border-radius: 10px;
    transition: width 0.5s var(--transition-smooth);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* ===== Question Container ===== */
.question-container {
    transition: all 0.3s var(--transition-smooth);
}

.question-container.question-exit {
    opacity: 0;
    transform: translateX(-20px);
}

.question-container.question-enter {
    animation: questionEnter 0.4s var(--transition-smooth) forwards;
}

@keyframes questionEnter {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== Question Emoji ===== */
.question-emoji {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    border-radius: 20px;
    font-size: 32px;
    margin-bottom: 16px;
    animation: emojiPop 0.4s var(--transition-smooth);
}

@keyframes emojiPop {
    0% {
        transform: scale(0);
    }

    70% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* ===== Likert Scale Buttons ===== */
.likert-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 18px 22px;
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: 16px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
    cursor: pointer;
    transition: all 0.25s var(--transition-smooth);
    text-align: right;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

.likert-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateX(-4px);
}

.likert-btn:active {
    transform: scale(0.98) translateX(-4px);
}

.likert-btn.selected {
    background: linear-gradient(135deg, var(--primary-gold) 0%, #c9986a 100%);
    border-color: var(--primary-gold);
    transform: translateX(-8px);
    box-shadow: 0 4px 20px rgba(212, 165, 116, 0.4);
}

.likert-btn.pulse {
    animation: btnPulse 0.4s var(--transition-smooth);
}

@keyframes btnPulse {
    0% {
        transform: scale(1) translateX(-8px);
    }

    50% {
        transform: scale(1.03) translateX(-8px);
    }

    100% {
        transform: scale(1) translateX(-8px);
    }
}

.likert-icon {
    font-size: 26px;
    min-width: 36px;
    text-align: center;
}

/* Stagger animation for buttons */
.animate-stagger {
    animation: staggerFadeIn 0.4s var(--transition-smooth) backwards;
}

@keyframes staggerFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Form Inputs ===== */
.form-input {
    width: 100%;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    color: white;
    font-size: 16px;
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s var(--transition-smooth);
    touch-action: manipulation;
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-gold);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 4px rgba(212, 165, 116, 0.15);
}

.form-input.input-success {
    border-color: var(--success);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15);
}

.form-input.input-error {
    border-color: var(--error);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
}

/* ===== Select Dropdowns ===== */
select.form-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 16px center;
    background-size: 20px;
    padding-left: 48px;
    cursor: pointer;
}

select.form-input option {
    background: var(--primary-blue);
    color: white;
    padding: 14px;
    font-family: 'Cairo', sans-serif;
}

/* ===== Result Badge Styles ===== */
.result-badge {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: badgePop 0.6s var(--transition-smooth);
}

@keyframes badgePop {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }

    70% {
        transform: scale(1.1) rotate(10deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.result-badge-gold {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
    box-shadow:
        0 0 40px rgba(251, 191, 36, 0.5),
        inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.result-badge-silver {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 50%, #2563eb 100%);
    box-shadow:
        0 0 40px rgba(59, 130, 246, 0.5),
        inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.result-badge-bronze {
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 50%, #7c3aed 100%);
    box-shadow:
        0 0 40px rgba(139, 92, 246, 0.5),
        inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.result-badge span {
    font-size: 52px;
    animation: emojiFloat 2s ease-in-out infinite;
}

@keyframes emojiFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

/* ===== Score Display ===== */
.score-display {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 24px;
}

.score-number {
    font-size: 48px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-gold), var(--primary-gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: scoreCountUp 0.8s var(--transition-smooth);
}

@keyframes scoreCountUp {
    from {
        opacity: 0;
        transform: scale(0.5);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== QR Code Section ===== */
.qr-section {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    animation: qrFadeIn 0.6s var(--transition-smooth) 0.2s backwards;
}

@keyframes qrFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.qr-container {
    background: white;
    border-radius: 16px;
    padding: 16px;
    display: inline-block;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    animation: qrPop 0.5s var(--transition-smooth) 0.4s backwards;
}

@keyframes qrPop {
    0% {
        transform: scale(0) rotate(-10deg);
    }

    70% {
        transform: scale(1.05) rotate(2deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
    }
}

.qr-code {
    width: 160px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-code canvas {
    max-width: 100%;
    height: auto;
}

/* Larger QR for tablets/interactive screens */
@media (min-width: 768px) {
    .qr-code {
        width: 200px;
        height: 200px;
    }

    .qr-container {
        padding: 20px;
    }
}

/* ===== Toast Notifications ===== */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 14px 24px;
    border-radius: 14px;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s var(--transition-smooth);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.toast-success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
}

.toast-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

/* ===== Animations ===== */
.animate-fade-in {
    animation: fadeIn 0.5s var(--transition-smooth) forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.animate-slide-up {
    animation: slideUp 0.5s var(--transition-smooth) forwards;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Loading Spinner ===== */
.loading-spinner {
    width: 64px;
    height: 64px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== Responsive Design ===== */
@media (max-width: 480px) {
    .glass-card {
        padding: 24px 18px;
        border-radius: 24px;
    }

    .btn-primary,
    .btn-whatsapp {
        padding: 16px 24px;
        font-size: 16px;
    }

    .likert-btn {
        padding: 16px 18px;
        font-size: 15px;
    }

    .likert-icon {
        font-size: 24px;
    }

    .result-badge {
        width: 100px;
        height: 100px;
    }

    .result-badge span {
        font-size: 44px;
    }

    .score-number {
        font-size: 40px;
    }
}

/* Tablet & Interactive Screens */
@media (min-width: 768px) {
    .screen {
        padding: 24px;
    }

    .glass-card {
        padding: 36px 32px;
        max-width: 500px;
        margin: 0 auto;
    }

    .btn-primary,
    .btn-whatsapp {
        padding: 20px 36px;
        font-size: 19px;
    }

    .likert-btn {
        padding: 20px 26px;
        font-size: 17px;
    }

    .result-badge {
        width: 140px;
        height: 140px;
    }

    .result-badge span {
        font-size: 60px;
    }
}

/* Large Interactive Screens */
@media (min-width: 1024px) {
    .glass-card {
        max-width: 550px;
        padding: 44px 40px;
    }

    .likert-btn:hover {
        transform: translateX(-8px) scale(1.02);
    }
}

/* ===== Hidden Utility ===== */
.hidden {
    display: none !important;
}

/* ===== Safe Area Support ===== */
@supports (padding: max(0px)) {
    body {
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
}