:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #ec4899;
    --background-gradient: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --success: #10b981;
    --error: #ef4444;
    --radius: 16px;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background: var(--background-gradient);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-main);
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* Background Abstract Shapes */
.background-blobs::before,
.background-blobs::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: var(--secondary-color);
    filter: blur(80px);
    opacity: 0.4;
    border-radius: 50%;
    z-index: -1;
    animation: float 10s infinite alternate;
}

.background-blobs::before {
    top: -50px;
    left: -50px;
}

.background-blobs::after {
    bottom: -50px;
    right: -50px;
    background: var(--primary-color);
}

@keyframes float {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(20px, 40px);
    }
}

.app-container {
    width: 100%;
    max-width: 800px;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header .logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

header h1 {
    font-weight: 300;
    font-size: 2rem;
    opacity: 0.9;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow);
    display: none;
    /* Hidden by default */
    animation: fadeIn 0.5s ease-out forwards;
    backdrop-filter: blur(10px);
}

.card.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-header {
    margin-bottom: 30px;
    text-align: center;
}

.card-header h2 {
    color: var(--primary-dark);
    margin-bottom: 10px;
}

.card-header p {
    color: var(--text-muted);
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-main);
}

input,
select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f9fafb;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    background: white;
}

/* Instructions */
.instructions {
    background: #eff6ff;
    border-left: 4px solid var(--primary-color);
    padding: 20px;
    border-radius: 8px;
    margin: 30px 0;
}

.instructions h3 {
    margin-bottom: 10px;
    color: var(--primary-dark);
    font-size: 1.1rem;
}

.instructions ul {
    list-style-position: inside;
    color: var(--text-muted);
}

.instructions li {
    margin-bottom: 5px;
}

/* Buttons */
button {
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    padding: 14px 28px;
    border-radius: 8px;
    border: none;
    transition: all 0.3s;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(to right, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.4);
}

.btn-secondary {
    background: white;
    color: var(--text-main);
    border: 2px solid var(--border-color);
    margin-top: 20px;
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Loader */
.loading-content {
    text-align: center;
    padding: 40px 0;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #e0e7ff;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Exam Badge */
.badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 99px;
    background: #e0e7ff;
    color: var(--primary-dark);
    margin: 0 5px;
}

/* Questions */
.question-item {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.question-text {
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.options-grid {
    display: grid;
    gap: 10px;
}

.option-label {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.option-label:hover {
    background: #f3f4f6;
}

.option-label input[type="radio"] {
    width: auto;
    margin-right: 12px;
}

.option-label.selected {
    border-color: var(--primary-color);
    background: #eff6ff;
}

/* Results */
.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: conic-gradient(var(--success) 0%, var(--success) 0%, #e5e7eb 0%);
    margin: 0 auto 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.score-circle::before {
    content: '';
    position: absolute;
    width: 130px;
    height: 130px;
    background: white;
    border-radius: 50%;
}

.score-circle span,
.score-circle small {
    position: relative;
    z-index: 2;
}

.score-circle span {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-main);
}

.score-circle small {
    color: var(--text-muted);
}

.feedback-section,
.corrections-section {
    margin-top: 30px;
}

.feedback-text {
    background: #f0fdf4;
    padding: 20px;
    border-radius: 8px;
    color: #166534;
    line-height: 1.6;
}

/* Correction Item */
.correction-item {
    background: #f9fafb;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid var(--text-muted);
}

.correction-item.correct {
    border-left-color: var(--success);
    background: #f0fdf4;
}

.correction-item.incorrect {
    border-left-color: var(--error);
    background: #fef2f2;
}

.correction-header {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    margin-bottom: 10px;
}

.correction-explanation {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 5px;
}

footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 30px;
    font-size: 0.9rem;
}

/* GTranslate Position */
.gtranslate_wrapper {
    position: absolute;
    top: 25px;
    right: 25px;
    z-index: 9999;
}

@media (max-width: 768px) {
    .gtranslate_wrapper {
        top: 10px;
        right: 10px;
    }
}