/* CSS Variables for easy customization */
:root {
    /* Colors */
  --primary-color: #ba0f06;
    --secondary-color: #2c3e50;
    --text-color: #333333;
    --background-color: #f9f9f9;
    --accent-color: #e74c3c;

    /* Font sizes */
    --font-size-small: 0.875rem;
    --font-size-medium: 1rem;
    --font-size-large: 1.25rem;
    --font-size-xlarge: 1.5rem;

    /* Spacing */
    --spacing-small: 0.5rem;
    --spacing-medium: 1rem;
    --spacing-large: 1.5rem;
    --spacing-xlarge: 2rem;

    /* Container widths */
    --container-small: 600px;
    --container-medium: 800px;
    --container-large: 1100px;

    /* Font family */
    --font-primary: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    color: var(--text-color);
    line-height: 1.6;
    font-weight: 600;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0;
    position: relative;
    z-index: 0;

    /* Background color as fallback */
    background-color: var(--background-color);

    /* Simplified background with all properties combined */
    background: linear-gradient(rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.15)),
                url('./images/back-02.jpg') center/cover fixed no-repeat;
}

.container {
    max-width: var(--container-medium);
    width: 100%;
    margin: auto;
    padding: var(--spacing-large);
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.5); /* More transparent to show background better */
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(2px); /* Further reduced blur effect */
    -webkit-backdrop-filter: blur(2px);
    z-index: 2;
    overflow: visible; /* Ensure content isn't clipped */
}

/* Header and main image */
header {
    text-align: center;
    margin-bottom: var(--spacing-medium);
    width: 100%;
    position: relative;
    z-index: 5;
    overflow: visible;
}

.main-image {
    margin-bottom: 0.25rem; /* Reduce from 0.5rem */
    display: block;
    width: 100%;
    max-width: 419px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 5;
    padding: var(--spacing-medium);
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.main-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

/* Social icons */
.social-icons {
    display: flex;
    justify-content: center;
    gap: var(--spacing-medium);
    margin-bottom: 0.5rem; /* Reduce from 1rem */
}

.social-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 120px; /* Fixed width for consistent spacing */
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-size: var(--font-size-large);
    text-decoration: none;
    transition: transform 0.3s, background-color 0.3s;
    margin-bottom: 5px;
}

.social-icon:hover {
    transform: translateY(-5px);
    background-color: var(--accent-color);
}

.icon-label {
    font-size: var(--font-size-small);
    color: var(--secondary-color);
    transition: color 0.3s;
    width: 100%;
    display: block;
    font-weight: 600;
    text-shadow: 0 0 1px rgba(255, 255, 255, 0.5);
}

.social-icon:hover + .icon-label {
    color: var(--primary-color);
}

/* Content */
.content {
    max-width: var(--container-small);
    margin: 0 auto;
    padding: 0.25rem; /* Reduce from 0.5rem */
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.05); /* Subtle border for better contrast */
}

.content p {
    margin-bottom: 0.25rem; /* Reduce from 0.5rem */
    font-size: var(--font-size-medium);
    text-align: justify;
    font-weight: 500;
    text-shadow: 0 0 1px rgba(255, 255, 255, 0.7);
}

/* Footer */
footer {
    margin-top: var(--spacing-xlarge);
    text-align: center;
    font-size: var(--font-size-small);
    color: var(--secondary-color);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: var(--spacing-medium);
    }

    .social-icons {
        gap: var(--spacing-small);
    }

    .social-item {
        width: 80px; /* Smaller fixed width on tablet */
    }

    .social-icon {
        width: 40px;
        height: 40px;
        font-size: var(--font-size-medium);
        margin-bottom: 5px;
    }

    .icon-label {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    :root {
        /* These are already set to these values in the main :root, 
           so we can remove the redundant declaration */
    }

    .social-item {
        width: 70px; /* Even smaller fixed width on mobile */
    }

    .social-icon {
        width: 35px;
        height: 35px;
    }

    .content p {
        font-size: var(--font-size-small);
    }
}

/* Contact Form Sliding Frame */
.contact-form-container {
    position: fixed;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, background-color 0.3s;
}

.contact-form-container.visible {
    opacity: 1;
    visibility: visible;
}

.contact-form-frame {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3), 0 0 1px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 500px;
    padding: var(--spacing-large);
    position: relative;
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s, box-shadow 0.3s;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.contact-form-container.visible .contact-form-frame {
    transform: scale(1);
    opacity: 1;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 2px rgba(0, 0, 0, 0.6);
}

.close-form {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: var(--font-size-large);
    color: var(--secondary-color);
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.close-form:hover {
    opacity: 1;
}

.contact-form-frame h3 {
    margin-bottom: var(--spacing-large);
    color: var(--primary-color);
    text-align: center;
    font-size: var(--font-size-large);
    font-weight: 700;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.contact-form .form-row {
    display: flex;
    gap: var(--spacing-medium);
    margin-bottom: var(--spacing-medium);
}

.contact-form .form-group {
    flex: 1;
    margin-bottom: var(--spacing-medium);
}

.contact-form label {
    display: block;
    margin-bottom: 5px;
    font-size: var(--font-size-small);
    color: var(--secondary-color);
    font-weight: 600;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: var(--font-primary);
    font-size: var(--font-size-medium);
    font-weight: 500;
}

.contact-form textarea {
    resize: vertical;
}

.contact-form .submit-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: var(--font-size-medium);
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: var(--spacing-small);
    width: 100%;
}

.contact-form .submit-button:hover {
    background-color: var(--accent-color);
}

.contact-form .submit-button:disabled {
    background-color: #999;
    cursor: not-allowed;
    opacity: 0.7;
}

.form-status {
    margin-bottom: 15px;
    text-align: center;
    font-size: var(--font-size-small);
    min-height: 20px;
}

/* Floating Captcha Frame */
.floating-captcha {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(2px);
}

.captcha-content {
    background-color: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: relative;
    max-width: 350px;
    width: 100%;
    text-align: center;
    animation: captchaFadeIn 0.3s ease;
}

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

.close-captcha {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 18px;
    color: #555;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.close-captcha:hover {
    opacity: 1;
}

.captcha-content h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--primary-color);
    font-weight: 700;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.captcha-content p {
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* Math validation styles */
.math-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 10px;
}

.math-question {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.math-answer {
    width: 120px;
    padding: 8px 12px;
    font-size: 18px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
}

.math-error {
    color: #e74c3c;
    font-size: 14px;
    margin-bottom: 15px;
    display: none;
}

.verify-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.verify-button:hover {
    background-color: var(--accent-color);
}

@media (max-width: 600px) {
    .contact-form .form-row {
        flex-direction: column;
        gap: var(--spacing-small);
    }

    .contact-form-frame {
        padding: var(--spacing-medium);
    }
}
