/* Reset and Base Styles - Optimized for Performance */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Performance optimizations */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Reduce layout shifts */
body {
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: #fdeec7;
    color: #1f0306;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
header {
    background-color: #1f0306;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

nav ul li a {
    color: #fdeec7;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

nav ul li a:hover,
nav ul li a.active {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Logo Container */
.logo-container {
    text-align: center;
    padding: clamp(0.25rem, 1vw, 0.5rem) clamp(0.5rem, 1.5vw, 0.75rem);
    margin: 0;
}

.logo-img {
    max-width: clamp(250px, 50vw, 400px);
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    padding: 0;
}

.logo {
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: bold;
    color: #1f0306;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
}

/* Main Content */
main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: clamp(0.25rem, 1vw, 0.5rem) clamp(0.75rem, 2vw, 1rem);
}

/* Intro Section */
.intro-section {
    text-align: center;
    margin-bottom: clamp(0.75rem, 2vw, 1rem);
    margin-top: clamp(0.25rem, 1vw, 0.5rem);
    padding: 0 clamp(0.5rem, 2vw, 1rem);
}

.intro-section h1 {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    margin-bottom: clamp(0.75rem, 2vw, 1rem);
    color: #1f0306;
    line-height: 1.3;
}

.intro-section p {
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Caution Box */
.caution-box {
    background-color: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: clamp(1rem, 3vw, 1.5rem);
    margin: clamp(1.5rem, 4vw, 2rem) clamp(0.5rem, 2vw, 0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.caution-box h2 {
    color: #856404;
    margin-bottom: clamp(0.5rem, 1.5vw, 0.75rem);
    font-size: clamp(1.2rem, 3vw, 1.5rem);
}

.caution-box p {
    color: #856404;
    margin: 0;
    font-size: clamp(0.9rem, 2vw, 1rem);
    line-height: 1.6;
}

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: #1f0306;
    color: #fdeec7;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.scroll-to-top:hover {
    background-color: #4a0d0f;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.scroll-to-top.show {
    display: flex;
}

/* Quiz Section */
.quiz-section {
    background-color: #fdeec7;
    border-radius: 8px;
    padding: clamp(1rem, 3vw, 2rem);
    margin: clamp(1rem, 2.5vw, 1.5rem) 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.quiz-section h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-bottom: clamp(0.75rem, 2vw, 1rem);
    color: #1f0306;
}

.quiz-section > p {
    font-size: clamp(0.95rem, 2vw, 1rem);
    margin-bottom: clamp(1rem, 3vw, 1.5rem);
}

.quiz-questions {
    display: grid;
    gap: clamp(0.25rem, 0.8vw, 0.5rem);
    margin: clamp(1rem, 2.5vw, 1.5rem) 0;
}

.question-item {
    padding: clamp(0.4rem, 1vw, 0.6rem) clamp(0.5rem, 1.2vw, 0.75rem);
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: clamp(0.4rem, 1vw, 0.6rem);
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.question-item strong {
    flex: 1;
    font-weight: bold;
    color: #1f0306;
}

.question-item input[type="checkbox"] {
    width: clamp(18px, 2.5vw, 20px);
    height: clamp(18px, 2.5vw, 20px);
    cursor: pointer;
    flex-shrink: 0;
    margin-right: clamp(0.4rem, 1vw, 0.5rem);
    min-width: 18px;
}

.quiz-buttons {
    display: flex;
    gap: clamp(0.75rem, 2vw, 1rem);
    justify-content: center;
    margin-top: clamp(1.5rem, 4vw, 2rem);
    flex-wrap: wrap;
}

.btn-calculate,
.btn-clear {
    background-color: #cff3cd;
    color: #1f0306;
    border: 2px solid #1f0306;
    padding: clamp(0.75rem, 2vw, 1rem) clamp(1.5rem, 4vw, 2rem);
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: clamp(150px, 30vw, 200px);
    width: 100%;
    max-width: 300px;
}

.btn-calculate:hover,
.btn-clear:hover {
    background-color: #a8e5a3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-calculate:active,
.btn-clear:active {
    transform: translateY(0);
}

/* PDF Section */
.pdf-section {
    margin: clamp(1rem, 2.5vw, 1.5rem) 0;
    padding: clamp(1rem, 3vw, 2rem);
    background-color: #fdeec7;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.pdf-section h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-bottom: clamp(0.75rem, 2vw, 1rem);
    color: #1f0306;
}

.pdf-links {
    display: flex;
    flex-direction: column;
    gap: clamp(0.75rem, 2vw, 1rem);
}

.pdf-link {
    color: #1f0306;
    text-decoration: none;
    padding: clamp(0.75rem, 2vw, 1rem);
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
    font-size: clamp(0.95rem, 2.5vw, 1.1rem);
    word-break: break-word;
}

.pdf-link:hover {
    background-color: #e9ecef;
    transform: translateX(5px);
}

/* Content Section */
.content-section {
    margin: clamp(1rem, 2.5vw, 1.5rem) 0;
    padding: clamp(1rem, 3vw, 2rem);
    background-color: #fdeec7;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.content-section h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin: clamp(1.5rem, 4vw, 2rem) 0 clamp(0.75rem, 2vw, 1rem) 0;
    color: #1f0306;
    line-height: 1.3;
}

.content-section h3 {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    margin: clamp(1rem, 3vw, 1.5rem) 0 clamp(0.75rem, 2vw, 1rem) 0;
    color: #1f0306;
    line-height: 1.4;
}

.content-section h4 {
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    margin: clamp(0.75rem, 2vw, 1rem) 0 clamp(0.5rem, 1.5vw, 0.75rem) 0;
    color: #1f0306;
}

.content-section p {
    margin-bottom: clamp(0.75rem, 2vw, 1rem);
    text-align: justify;
    font-size: clamp(0.95rem, 2vw, 1rem);
    line-height: 1.7;
}

.content-section ul {
    margin: 1rem 0 1rem 2rem;
}

.content-section li {
    margin-bottom: 0.5rem;
}

/* Results Page Styles */
.results-section {
    text-align: center;
    padding: clamp(1rem, 3vw, 2rem);
}

.results-section h1 {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    margin-bottom: clamp(1.5rem, 4vw, 2rem);
    color: #1f0306;
    line-height: 1.3;
}

.score-display {
    margin: clamp(1.5rem, 4vw, 2rem) 0;
}

.score-circle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: clamp(150px, 30vw, 200px);
    height: clamp(150px, 30vw, 200px);
    border-radius: 50%;
    background: linear-gradient(135deg, #cff3cd 0%, #a8e5a3 100%);
    border: clamp(3px, 1vw, 5px) solid #1f0306;
    margin: 0 auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#scoreValue {
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: bold;
    color: #1f0306;
    line-height: 1;
}

.score-label {
    font-size: clamp(1rem, 3vw, 1.5rem);
    color: #1f0306;
    margin-top: -0.3rem;
}

.score-message {
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    margin-top: clamp(0.75rem, 2vw, 1rem);
    color: #1f0306;
    font-weight: 500;
}


.results-actions {
    display: flex;
    gap: clamp(0.75rem, 2vw, 1rem);
    justify-content: center;
    margin: clamp(1.5rem, 4vw, 2rem) 0;
    flex-wrap: wrap;
}

.btn-retake,
.btn-print {
    background-color: #cff3cd;
    color: #1f0306;
    border: 2px solid #1f0306;
    padding: clamp(0.75rem, 2vw, 1rem) clamp(1.5rem, 4vw, 2rem);
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    min-width: clamp(150px, 30vw, 200px);
    width: 100%;
    max-width: 300px;
}

.btn-retake:hover,
.btn-print:hover {
    background-color: #a8e5a3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.share-section {
    margin: clamp(1rem, 2.5vw, 1.5rem) 0;
    padding: clamp(1rem, 3vw, 1.5rem);
    background-color: #fdeec7;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.share-section h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #1f0306;
}

/* Social Share Buttons */
.social-share {
    margin: clamp(1rem, 2.5vw, 1.5rem) 0;
    padding: clamp(1rem, 3vw, 1.5rem);
    background-color: #fdeec7;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.social-share h3 {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    margin-bottom: clamp(0.75rem, 2vw, 1rem);
    color: #1f0306;
}

.share-buttons {
    display: flex;
    gap: clamp(0.5rem, 1.5vw, 1rem);
    justify-content: center;
    flex-wrap: wrap;
}

.share-btn {
    padding: clamp(0.6rem, 1.5vw, 0.75rem) clamp(1rem, 2.5vw, 1.5rem);
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    color: #ffffff;
    border: none;
    cursor: pointer;
    font-size: clamp(0.85rem, 2vw, 1rem);
    white-space: nowrap;
}

.share-btn.facebook {
    background-color: #1877f2;
}

.share-btn.facebook:hover {
    background-color: #166fe5;
    transform: translateY(-2px);
}

.share-btn.twitter {
    background-color: #1da1f2;
}

.share-btn.twitter:hover {
    background-color: #1a91da;
    transform: translateY(-2px);
}

.share-btn.reddit {
    background-color: #ff4500;
}

.share-btn.reddit:hover {
    background-color: #e63d00;
    transform: translateY(-2px);
}

.share-btn.pinterest {
    background-color: #bd081c;
}

.share-btn.pinterest:hover {
    background-color: #a00718;
    transform: translateY(-2px);
}

/* Content Page Styles */
.content-page {
    max-width: 900px;
    margin: 0 auto;
    padding: clamp(1rem, 3vw, 2rem);
    background-color: #fdeec7;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.content-page h1 {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    margin-bottom: clamp(1rem, 3vw, 1.5rem);
    color: #1f0306;
    line-height: 1.3;
}

.content-page h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin: clamp(1.5rem, 4vw, 2rem) 0 clamp(0.75rem, 2vw, 1rem) 0;
    color: #1f0306;
    line-height: 1.3;
}

.content-page h3 {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    margin: clamp(1rem, 3vw, 1.5rem) 0 clamp(0.75rem, 2vw, 1rem) 0;
    color: #1f0306;
    line-height: 1.4;
}

.content-page p {
    margin-bottom: clamp(0.75rem, 2vw, 1rem);
    text-align: justify;
    font-size: clamp(0.95rem, 2vw, 1rem);
    line-height: 1.7;
}

.content-page ul {
    margin: 1rem 0 1rem 2rem;
}

.content-page li {
    margin-bottom: 0.5rem;
}

.content-page a {
    color: #1f0306;
    text-decoration: underline;
}

.content-page a:hover {
    color: #4a0d0f;
}

.contact-info {
    margin: clamp(1.5rem, 4vw, 2rem) 0;
}

.contact-info h3 {
    margin-top: clamp(1rem, 3vw, 1.5rem);
    color: #1f0306;
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
}

.contact-info h3 a {
    color: #1f0306;
    text-decoration: none;
}

.contact-info h3 a:hover {
    text-decoration: underline;
}

/* Contact Form */
.contact-form-container {
    margin: clamp(1rem, 2.5vw, 1.5rem) 0;
    padding: clamp(1rem, 3vw, 2rem);
    background-color: #fdeec7;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: clamp(1rem, 3vw, 1.5rem);
}

.form-group label {
    display: block;
    margin-bottom: clamp(0.4rem, 1vw, 0.5rem);
    font-weight: 600;
    color: #1f0306;
    font-size: clamp(0.95rem, 2vw, 1rem);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: clamp(0.6rem, 1.5vw, 0.75rem);
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: clamp(0.95rem, 2vw, 1rem);
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1f0306;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.btn-submit {
    background-color: #cff3cd;
    color: #1f0306;
    border: 2px solid #1f0306;
    padding: clamp(0.75rem, 2vw, 1rem) clamp(1.5rem, 4vw, 2rem);
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.btn-submit:hover {
    background-color: #a8e5a3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.form-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 6px;
    text-align: center;
    display: none;
}

.form-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.form-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Footer */
footer {
    background-color: #1f0306;
    color: #fdeec7;
    padding: clamp(1.5rem, 4vw, 2rem) clamp(0.75rem, 2vw, 1rem);
    text-align: center;
    margin-top: auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: clamp(1rem, 2.5vw, 1.5rem);
    margin-bottom: clamp(0.75rem, 2vw, 1rem);
}

.footer-links a {
    color: #fdeec7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.social-media {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.social-icon {
    color: #fdeec7;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.social-icon:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
}

footer p {
    margin-top: clamp(0.75rem, 2vw, 1rem);
    font-size: clamp(0.85rem, 2vw, 0.9rem);
}

/* Responsive Design */
@media (max-width: 768px) {
    .logo-img {
        max-width: clamp(200px, 60vw, 300px);
    }
    
    .logo {
        font-size: clamp(1.5rem, 6vw, 2rem);
    }
    
    .logo-container {
        padding: clamp(0.2rem, 0.8vw, 0.4rem) clamp(0.4rem, 1.2vw, 0.6rem);
        margin: 0;
    }

    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 20px;
    }

    .intro-section h1 {
        font-size: 2rem;
    }

    .quiz-section {
        padding: 1rem;
    }

    .question-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .score-circle {
        width: 150px;
        height: 150px;
    }

    #scoreValue {
        font-size: 3rem;
    }

    .content-page {
        padding: 1rem;
    }

    nav ul {
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .logo-img {
        max-width: clamp(180px, 70vw, 250px);
    }
    
    .logo {
        font-size: clamp(1.3rem, 7vw, 1.8rem);
        letter-spacing: 1px;
    }

    .scroll-to-top {
        bottom: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .intro-section h1 {
        font-size: 1.5rem;
    }

    .btn-calculate,
    .btn-clear,
    .btn-retake,
    .btn-print {
        width: 100%;
        min-width: unset;
    }

    .quiz-buttons,
    .results-actions {
        flex-direction: column;
    }
}

/* Print Styles */
@media print {
    header,
    footer,
    .scroll-to-top,
    .social-share,
    .quiz-buttons,
    .results-actions {
        display: none;
    }

    body {
        background-color: #fdeec7;
    }

    .score-display {
        page-break-inside: avoid;
    }
}
