/* General Styles */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #4776E6;
    --primary-light: #e8f0ff;
    --primary-dark: #3264d0;
    --secondary-color: #FF5E62;
    --secondary-light: #fff5f5;
    --text-color: #333;
    --text-light: #6c757d;
    --bg-color: #f8f9fa;
    --border-radius: 12px;
    --card-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
    --gradient-primary: linear-gradient(135deg, #4776E6, #8E54E9);
    --gradient-secondary: linear-gradient(135deg, #FF5E62, #FF9966);
    --box-shadow-hover: 0 10px 30px rgba(71, 118, 230, 0.2);
    --box-shadow-light: 0 5px 15px rgba(0, 0, 0, 0.05);
    --round-button-radius: 50%;
    --circle-dimension: 50px;
}

body, html {
    background-color: #f7f9fc !important;
    color: #333 !important;
    font-family: 'Nunito', sans-serif;
    overflow-x: hidden;
    line-height: 1.6;
}

/* YÜKLEME EKRANI STILLERİ */
#loading-screen { /* Bu ID ana yükleme ekranı içindir */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: #f7f9fc;
    z-index: 10000;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0s 0.5s;
}

.loading-hidden {
    opacity: 0 !important;
    pointer-events: none;
    visibility: hidden !important;
    transition-delay: 0s !important;
}

/* İçeriği başlangıçta gizle, JS ile göstereceğiz */
/* HTML'de inline style olarak opacity:0 ve visibility:hidden eklemek daha güvenlidir. */
/* Ancak CSS'te de bu başlangıç durumunu tanımlayalım ve .content-visible ile override edelim */
#content {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0s 0.5s;
    /* !important eklenmesi, Bootstrap'in d-flex gibi sınıflarının başlangıçta görünür yapmasını engeller. */
    /* Ya da HTML'de inline style ile başlangıçta gizli tutulmalı. */
}

.content-visible {
    opacity: 1 !important;
    visibility: visible !important;
    transition-delay: 0.5s !important;
    height: 100%;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* Wrapper */
.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
    position: relative;
    min-height: 100vh;
}

/* Content */
#content {
    width: 100%;
    transition: all 0.3s ease;
    margin-left: 0;
    background-color: #f7f9fc !important;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(71, 118, 230, 0.05) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(142, 84, 233, 0.07) 0%, transparent 25%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(240, 247, 255, 0.9) 100%);
    background-attachment: fixed;
    color: #333 !important;
}

/* Kullanıcı bilgisinin yeni konumu (sağ üst) */
/* User Profile Component stilleri artık user_component/user-profile.css dosyasında */

/* NOT: #generator-loading-screen ve .generator-loading-spinner artık kullanılmıyor, kaldırıldı. */

/* Improved Loading Overlay (Soru oluşturulurken kullanılan overlay) */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.94);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.loading-content {
    text-align: center;
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    width: 90%;
    max-width: 400px;
    transform: translateY(0);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px);
        box-shadow: 0 10px 20px rgba(71, 118, 230, 0.1);
    }
    50% {
        transform: translateY(-10px);
        box-shadow: 0 20px 30px rgba(71, 118, 230, 0.15);
    }
    100% {
        transform: translateY(0px);
        box-shadow: 0 10px 20px rgba(71, 118, 230, 0.1);
    }
}

.loading-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.loading-icon {
    width: 70px;
    height: 70px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(71, 118, 230, 0.2);
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.loading-icon i {
    font-size: 2rem;
    color: white;
}

.loading-icon::before,
.loading-icon::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--gradient-primary);
    z-index: -1;
    opacity: 0.3;
}

.loading-icon::before {
    animation: pulse-ring 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

.loading-icon::after {
    animation: pulse-ring 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite 0.3s;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.95);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.2);
        opacity: 0;
    }
    100% {
        transform: scale(0.95);
        opacity: 0;
    }
}

.loading-spinner-container {
    margin-top: 10px;
}

.loading-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 20px;
}

.dot {
    width: 10px;
    height: 10px;
    margin: 0 5px;
    border-radius: 50%;
    background-color: var(--primary-color);
    animation: dot-animation 1.4s infinite ease-in-out both;
}

.dot-1 {
    animation-delay: -0.32s;
}

.dot-2 {
    animation-delay: -0.16s;
}

@keyframes dot-animation {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.loading-content h4 {
    color: var(--primary-color);
    font-weight: 700;
    margin-top: 15px;
    margin-bottom: 5px;
}

.loading-content p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin: 0;
}

.loading-progress {
    width: 100%;
    height: 6px;
    background-color: #eff3f9;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 15px;
    position: relative;
}

.loading-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 30%;
    background: var(--gradient-primary);
    border-radius: 10px;
    animation: progress-animation 2s ease-in-out infinite;
}

@keyframes progress-animation {
    0% {
        left: -30%;
        width: 30%;
    }
    50% {
        width: 30%;
    }
    70% {
        width: 70%;
    }
    100% {
        left: 100%;
        width: 30%;
    }
}

/* Calculator Icon */
.calculator-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: 50%;
    margin: 0 auto 20px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(71, 118, 230, 0.3);
    animation: pulse 1.5s infinite alternate;
}

.calculator-icon::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--gradient-primary);
    opacity: 0.3;
    z-index: -1;
    transform: scale(1.2);
    animation: pulse 1.5s infinite alternate 0.5s;
}

.calculator-icon i {
    font-size: 2.5rem;
    color: white;
}

.calculator-icon::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--gradient-primary);
    opacity: 0.15;
    z-index: -2;
    transform: scale(1.4);
    animation: pulse 1.5s infinite alternate 1s;
}

/* Background accents */
.accent-circle {
    position: fixed;
    border-radius: 50%;
    z-index: -1;
    filter: blur(80px);
    opacity: 0.5;
}

.accent-circle-1 {
    width: 500px;
    height: 500px;
    background: rgba(71, 118, 230, 0.1);
    top: -100px;
    right: -100px;
}

.accent-circle-2 {
    width: 400px;
    height: 400px;
    background: rgba(142, 84, 233, 0.1);
    bottom: -100px;
    left: -100px;
}

/* Card Styles */
.card {
    border-radius: var(--border-radius);
    border: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    background: white;
    box-shadow: var(--box-shadow-light);
}

.card:hover {
    box-shadow: var(--box-shadow-hover);
    transform: translateY(-5px);
}

.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Form Elements - Improved */
.form-container {
    border-radius: var(--border-radius);
    padding: 0 1.5rem;
    position: relative;
}

.form-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-light);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.2rem;
    box-shadow: 0 3px 10px rgba(71, 118, 230, 0.1);
    transition: all 0.3s ease;
}

.form-group:hover .form-icon {
    transform: scale(1.05);
    background: var(--primary-color);
    color: #fff;
}

.form-text {
    color: #6c757d;
    font-size: 0.85rem;
}

.form-label {
    display: inline-block;
    font-size: 1.1rem;
}

/* Progress Bar */
.progress {
    height: 8px;
    border-radius: 4px;
    background-color: #e9ecef;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Number Input Improvements */
.number-input-container {
    width: 100%;
}

.number-input {
    display: flex;
    align-items: stretch;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.number-input button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    background: white;
    border: 1px solid var(--primary-color);
    transition: all 0.3s ease;
    font-size: 1rem;
    cursor: pointer;
    color: var(--primary-color);
}

.number-input button:hover {
    background: var(--primary-color);
    color: white;
}

.number-input input {
    flex: 1;
    text-align: center;
    border: 1px solid var(--primary-color);
    border-radius: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    appearance: textfield;
    -moz-appearance: textfield;
    padding: 0.5rem 1rem;
}

.number-input input:focus {
    box-shadow: none;
    border-color: var(--primary-color);
}

.number-input input::-webkit-outer-spin-button,
.number-input input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Range Slider */
.range-slider {
    width: 100%;
    padding: 0 10px;
}

.form-range {
    cursor: pointer;
    height: 8px;
}

.form-range::-webkit-slider-thumb {
    background: var(--primary-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    height: 20px;
    width: 20px;
    margin-top: -6px;
}

.form-range::-moz-range-thumb {
    background: var(--primary-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    height: 20px;
    width: 20px;
}

.range-labels {
    padding: 0 10px;
    margin-top: 5px;
    color: #6c757d;
}

/* Difficulty buttons improved */
.difficulty-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.difficulty-btn {
    padding: 15px 20px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.difficulty-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.difficulty-btn i {
    color: #ffd700;
    transition: all 0.3s ease;
}

.difficulty-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(71, 118, 230, 0.15);
}

.difficulty-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(71, 118, 230, 0.2);
    transform: translateY(-3px);
}

.difficulty-btn.active i {
    color: #fff;
}

/* Generate Button Improvements */
#generate-btn {
    display: block;
    width: 100%;
    padding: 16px 20px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(71, 118, 230, 0.2);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

#generate-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
    z-index: -1;
}

#generate-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(71, 118, 230, 0.3);
}

#generate-btn:hover::after {
    left: 100%;
}

#generate-btn:active {
    transform: translateY(-2px);
}

#generate-btn:disabled {
    background: #e2e8f0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#generate-btn:disabled::after {
    display: none;
}

/* Textarea improvements */
.floating-input textarea.form-control {
    min-height: 120px;
    resize: vertical;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    padding: 1.2rem;
    font-size: 1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.floating-input textarea.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(71, 118, 230, 0.1);
}

/* Result Container Improvements */
#result-container {
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.5s ease;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.result-header h3 {
    font-weight: 700;
    color: var(--primary-color);
}

.result-actions button {
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.result-actions button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

#questions-display {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) inset;
    font-size: 1rem;
    line-height: 1.7;
}

/* Questions content formatting */
.questions-content pre {
    white-space: pre-wrap;
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    background: transparent;
    padding: 0;
    margin: 0;
    color: var(--text-color);
}

.questions-content pre strong {
    color: var(--primary-color);
    font-weight: 700;
}

.questions-content pre em {
    font-style: italic;
    color: var(--text-dark);
}

/* Responsive adjustments */
@media (max-width: 992px) {
    #content {
        margin-left: 0;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .calculator-icon {
        width: 70px;
        height: 70px;
    }

    .calculator-icon i {
        font-size: 2rem;
    }

    .difficulty-buttons {
        flex-direction: column;
    }

    .difficulty-btn {
        width: 100%;
    }

    .result-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .result-actions {
        display: flex;
        width: 100%;
        gap: 10px;
    }

    .result-actions button {
        flex: 1;
        padding: 10px;
        font-size: 0.9rem;
    }

    .form-group {
        margin-bottom: 20px;
    }
}

@media (max-width: 576px) {
    .calculator-icon {
        width: 60px;
        height: 60px;
    }

    .calculator-icon i {
        font-size: 1.8rem;
    }

    .user-name {
        font-size: 0.8rem;
        max-width: 90px;
    }

    .navbar-profile-btn {
        padding: 6px;
    }
}

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.05);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* Questions content improved styling */
.question-content {
    background-color: #fff;
    border-radius: 12px;
    padding: 20px;
    line-height: 1.8;
    color: var(--text-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) inset;
    counter-reset: item;
}

.question-content h1,
.question-content h2,
.question-content h3 {
    font-weight: 700;
    color: var(--primary-color);
    margin: 1.5em 0 0.8em 0;
}

.question-content h2 {
    font-size: 1.6rem;
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 10px;
    margin-top: 0;
}

.question-content h3 {
    font-size: 1.25rem;
    margin-top: 1.5em;
}

.questions-header {
    color: var(--primary-color);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1em;
    position: relative;
    padding-left: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(71, 118, 230, 0.2);
    margin-bottom: 25px;
}

.questions-header:before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: var(--gradient-primary);
    border-radius: 3px;
}

.solutions-header {
    margin-top: 3em;
    color: var(--secondary-color);
    font-size: 1.8rem;
    font-weight: 700;
    padding-left: 15px;
    position: relative;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(71, 118, 230, 0.2);
    margin-bottom: 25px;
}

.solutions-header:before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: var(--gradient-secondary);
    border-radius: 3px;
}

.question-content ul {
    list-style-type: none;
    padding-left: 10px;
    margin-bottom: 1.5em;
}

.question-content .question-item {
    font-weight: 600;
    margin: 20px 0 15px 0;
    color: var(--primary-dark);
    font-size: 1.1rem;
    position: relative;
    padding-left: 25px;
}

.question-content .question-item:before {
    content: counter(item) ". ";
    counter-increment: item;
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: 700;
}

.question-content .option-item {
    margin: 8px 0 8px 30px;
    position: relative;
    padding-left: 25px;
    font-weight: 500;
}

.question-content p {
    margin-bottom: 1.2em;
    line-height: 1.8;
}

.question-content strong {
    color: var(--primary-color);
    font-weight: 700;
}

.question-content em {
    font-style: italic;
    color: var(--text-light);
}

/* Format pre tags properly */
.question-content pre {
    white-space: pre-wrap;
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    line-height: 1.8;
    background-color: transparent;
    padding: 0;
    margin: 0;
    color: inherit;
}

/* Answer Text Styling */
.question-content .answer-text {
    color: #ff5e62;
    font-weight: 700;
    background-color: rgba(255, 94, 98, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
}

/* Counter reset for proper numbering */
.question-content {
    counter-reset: item;
}

/* Options formatting improvement */
.question-content .option-item:before {
    content: attr(data-option);
    position: absolute;
    left: 0;
    width: 24px;
    height: 24px;
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1;
}

/* Improved border styles for headings */
.questions-header, .solutions-header {
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(71, 118, 230, 0.2);
    margin-bottom: 25px;
}

/* Better code and math formatting */
.question-content code {
    font-family: 'Consolas', monospace;
    background-color: rgba(71, 118, 230, 0.08);
    padding: 2px 5px;
    border-radius: 4px;
    color: var(--primary-dark);
    font-size: 0.95em;
}

/* Improve spacing between items */
.question-content p {
    margin-bottom: 1.2em;
    line-height: 1.8;
}

/* Add animation for PDF download success */
@keyframes pulse-success {
    0% {
        box-shadow: 0 0 0 0 rgba(71, 118, 230, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(71, 118, 230, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(71, 118, 230, 0);
    }
}

.pdf-download-success {
    animation: pulse-success 1.5s;
}

/* Options formatting improvement */
.question-list {
    list-style-type: none;
    padding-left: 0 !important;
    counter-reset: item;
}

.question-content .option-item {
    display: flex !important;
    align-items: flex-start;
    margin: 10px 0 10px 30px !important;
    position: relative;
    padding-left: 0 !important;
    font-weight: 500;
}

.question-content .option-item .option-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: 50%;
    font-weight: 600;
    margin-right: 12px;
    flex-shrink: 0;
    line-height: 1;
}

.question-content .option-item .option-text {
    flex-grow: 1;
    padding-top: 3px;
}

/* Remove the pseudo element that was adding the option letter since we now have it as part of the content */
.question-content .option-item:before {
    content: none;
}

/* Improve break avoidance for PDF generation */
.question-item,
.option-item,
.question-content h1,
.question-content h2,
.question-content h3,
.questions-header,
.solutions-header {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
}

.question-item {
    break-after: avoid;
    page-break-after: avoid;
    margin-top: 25px !important;
}

/* Ensure new questions always start on a new page in PDF */
@media print {
    .question-item {
        page-break-before: auto;
    }

    .option-item {
        break-inside: avoid;
        page-break-inside: avoid;
        display: flex !important;
    }

    /* Force new page for solutions */
    .solutions-header {
        page-break-before: always;
    }
}

/* PDF specific styling improvements */
.pdf-question-wrapper {
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 20px;
    padding-bottom: 5px;
}

.question-content .option-item {
    display: flex !important;
    align-items: flex-start;
    margin: 10px 0 10px 30px !important;
    position: relative;
    padding-left: 0 !important;
    font-weight: 500;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
}

.question-content .option-item .option-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: 50%;
    font-weight: 600;
    margin-right: 12px;
    flex-shrink: 0;
    line-height: 1;
}

.question-content .option-item .option-text {
    flex-grow: 1;
    padding-top: 3px;
}

/* Added special CSS for better rendering */
@page {
    margin: 15mm;
    size: A4;
}

@media print {
    body {
        width: 210mm;
        height: 297mm;
        margin: 0;
        padding: 0;
    }

    .pdf-title {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    .question-list {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .question-item {
        break-inside: avoid;
        page-break-inside: avoid;
        break-after: avoid;
        page-break-after: avoid;
    }

    .option-item {
        display: flex !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }

    .pdf-page-break {
        display: block;
        page-break-before: always;
        break-before: always;
    }
}

/* Option wrapper for better styling */
.option-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
}

/* Improve visibility for option text */
.option-text {
    display: inline-block;
    padding-top: 2px;
}

/* Better formatting for question lists */
.question-list {
    display: block !important;
    width: 100% !important;
    counter-reset: question-counter;
    margin-bottom: 15px;
}

/* Make sure items are displayed properly */
.question-item {
    display: block !important;
    width: 100% !important;
    margin-top: 20px !important;
    margin-bottom: 15px !important;
    counter-increment: question-counter;
}

/* Remove old option styling since we use a new approach */
.question-content .option-item:before {
    content: none !important;
}

/* Soru görüntüleme stilleri */
.questions-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.questions-content:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.questions-content pre {
    white-space: pre-wrap;
    font-family: 'Nunito', sans-serif;
    line-height: 1.7;
    font-size: 1.1rem;
    color: #333;
    font-weight: normal;
}

/* Section titles */
.section-title {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 30px 0 20px;
    padding-bottom: 8px;
    border-bottom: 2px solid;
}

.questions-title {
    color: #4776E6;
    border-color: #4776E6;
}

.solutions-title {
    color: #3cb371;
    border-color: #3cb371;
    margin-top: 60px;
}

/* Question numbers */
.question-number {
    font-weight: 700;
    color: #4776E6;
    font-size: 1.2rem;
    margin-right: 5px;
}

/* Option letters */
.option-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 25px;
    height: 25px;
    background: #e8f0ff;
    color: #4776E6;
    border-radius: 50%;
    font-weight: bold;
    margin-right: 8px;
    font-size: 0.9rem;
}

/* Math symbols */
.math-symbol {
    font-family: 'Cambria Math', 'Times New Roman', serif;
    color: #333;
    font-weight: normal;
    padding: 0 2px;
}

/* Root symbol styling */
.root-symbol {
    font-family: 'Cambria Math', 'Times New Roman', serif;
    font-size: 1.2em;
    position: relative;
    top: 2px;
    color: #333;
}

.root-expression {
    border-top: 1px solid #333;
    padding: 0 2px;
}

/* Fraction styling */
.fraction {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin: 0 4px;
    vertical-align: middle;
    font-size: 0.95em;
    line-height: 1.2;
    position: relative;
    top: -2px;
}

.numerator {
    border-bottom: 1px solid #333;
    padding: 0 4px;
    margin-bottom: 1px;
}

.denominator {
    padding: 0 4px;
    margin-top: 1px;
}

/* Answer styling */
.answer-label {
    font-weight: 700;
    color: #3cb371;
    margin-right: 5px;
}

.answer-text {
    color: #3cb371;
    font-weight: 500;
    background-color: rgba(60, 179, 113, 0.08);
    padding: 2px 5px;
    border-radius: 4px;
}

/* Result container animation */
#result-container {
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Enhanced success message */
.success-message {
    position: relative;
    background-color: #d4edda;
    color: #155724;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.4s ease-out forwards;
    box-shadow: 0 3px 10px rgba(21, 87, 36, 0.1);
    border-left: 4px solid #3cb371;
}

.success-message i {
    font-size: 1.3rem;
    color: #3cb371;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Enhanced AI styling */
.ai-title {
    color: #4776E6;
    font-weight: 700;
    font-size: 1.15em;
    display: inline-block;
    margin: 5px 0;
}

.ai-subtitle {
    color: #555;
    font-weight: 600;
}

.ai-semi-bold {
    font-weight: 600;
    color: #555;
    border-bottom: 1px dotted #ccc;
}

/* Enhanced question display and spacing */
.question-item {
    padding: 18px;
    margin: 20px 0;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    border-left: 3px solid #4776E6;
}

.question-item:hover {
    box-shadow: 0 5px 15px rgba(71, 118, 230, 0.12);
    transform: translateY(-2px);
    background-color: rgba(255, 255, 255, 0.9);
}

.question-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #4776E6;
    opacity: 0.1;
}

.question-number {
    font-weight: 700;
    color: #4776E6;
    font-size: 1.3rem;
    margin-right: 5px;
    position: relative;
    z-index: 1;
}

.question-number::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    background: rgba(71, 118, 230, 0.1);
    border-radius: 50%;
    left: -5px;
    top: -5px;
    z-index: -1;
}

/* Option letters with improved styling */
.option-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    background: #e8f0ff;
    color: #4776E6;
    border-radius: 50%;
    font-weight: bold;
    margin-right: 8px;
    font-size: 0.9rem;
    margin-left: 10px;
    box-shadow: 0 2px 4px rgba(71, 118, 230, 0.15);
}

/* Enhanced section titles */
.section-title {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    margin: 30px 0 30px;
    padding: 12px 20px;
    border-radius: 10px;
    color: white;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.section-title::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
    z-index: -1;
}

.questions-title {
    background: linear-gradient(135deg, #4776E6, #8E54E9);
    box-shadow: 0 4px 15px rgba(71, 118, 230, 0.2);
}

.solutions-title {
    background: linear-gradient(135deg, #3cb371, #2e8b57);
    box-shadow: 0 4px 15px rgba(60, 179, 113, 0.2);
    margin-top: 60px;
    margin-bottom: 30px;
}

/* Enhanced content styling */
.questions-content pre {
    white-space: pre-wrap;
    font-family: 'Nunito', sans-serif;
    line-height: 1.7;
    font-size: 1.1rem;
    color: #333;
    font-weight: normal;
}

/* Improved answer styling */
.answer-label {
    font-weight: 700;
    color: #3cb371;
    margin-right: 5px;
}

.answer-text {
    color: #3cb371;
    font-weight: 500;
    background-color: rgba(60, 179, 113, 0.08);
    padding: 4px 8px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(60, 179, 113, 0.1);
    display: inline-block;
    margin-top: 2px;
}

/* Improve PDF generation for questions */
@media print {
    .question-item {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        margin: 15px 0 !important;
        padding: 15px !important;
        border-left: 2px solid #4776E6 !important;
        background-color: white !important;
        box-shadow: none !important;
    }

    .section-title {
        page-break-after: avoid !important;
        break-after: avoid !important;
        color: #333 !important;
        background: white !important;
        border: 2px solid #e0e0e0 !important;
        box-shadow: none !important;
    }

    .questions-title {
        border-color: #4776E6 !important;
        color: #4776E6 !important;
    }

    .solutions-title {
        border-color: #3cb371 !important;
        color: #3cb371 !important;
        page-break-before: always !important;
        break-before: always !important;
    }
}

/* Solution items styling */
.solution-item {
    padding: 18px;
    margin: 20px 0;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    border-left: 3px solid #3cb371;
}

.solution-item:hover {
    box-shadow: 0 5px 15px rgba(60, 179, 113, 0.12);
    transform: translateY(-2px);
    background-color: rgba(255, 255, 255, 0.9);
}

.solution-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #3cb371;
    opacity: 0.1;
}

.solution-number {
    font-weight: 700;
    color: #3cb371;
    font-size: 1.3rem;
    margin-right: 5px;
    position: relative;
    z-index: 1;
}

.solution-number::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    background: rgba(60, 179, 113, 0.1);
    border-radius: 50%;
    left: -5px;
    top: -5px;
    z-index: -1;
}


/* Sol Üst Geri Butonu Stili */
.back-button {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    padding: 0;
    box-shadow: 0 4px 10px rgba(220, 53, 69, 0.2);
    transition: all 0.3s ease;
}

.back-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(220, 53, 69, 0.3);
}