@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');

* {
    font-family: "Roboto", sans-serif;
    font-optical-sizing: auto;
    font-weight: 450;
    font-style: normal;
    font-variation-settings: "wdth" 100;
    box-sizing: border-box;
}

main, body {
    margin: 0;
    padding: 0;
}

h1 {
    text-align: center;
    margin: 0 0 2rem 0;
    font-size: 2rem;
    font-weight: 300;
    color: #2c3e50;
}

.content {
    height: 100vh;
    width: 100vw;
    overflow-y: auto;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 2rem 1rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.content::-webkit-scrollbar {
    display: none;
}

.survey-container {
    max-width: 700px;
    width: 100%;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 3rem 2.5rem;
    margin: 2rem auto;
}

.survey-form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.question-block {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.question-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: #2c3e50;
    margin: 0;
    line-height: 1.5;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-left: 0.5rem;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.radio-option:hover {
    background-color: #f8f9fa;
}

.radio-option input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #3498db;
}

.radio-option span {
    font-size: 1rem;
    color: #555;
    line-height: 1.4;
}

.text-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    color: #2c3e50;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    outline: none;
}

.text-input::placeholder {
    color: #aaa;
}

.text-input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.submit-btn {
    margin-top: 1rem;
    padding: 1rem 2rem;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    align-self: center;
    min-width: 200px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.submit-btn:hover {
    background-color: #2980b9;
}

.submit-btn:active {
    transform: scale(0.98);
}

.submit-btn:disabled {
    background-color: #8c9aac;
    cursor: not-allowed;
    transform: none;
}

/* Spinner animation */
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

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

/* Modal overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Modal window */
.modal {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    height: 80%;
    width: 70%;
    position: relative;
    transform: scale(0.7);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.3s ease;
}

.modal-overlay.show .modal {
    transform: scale(1);
    opacity: 1;
}

/* Close button */
.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: #95a5a6;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease, color 0.2s ease;
    line-height: 1;
    padding: 0;
}

.close-btn:hover {
    background-color: #f8f9fa;
    color: #2c3e50;
}

.close-btn:active {
    transform: scale(0.95);
}

/* Modal content placeholder */
.modal-content {
    height: 100%;
    display: flex;
    justify-content: center;
    color: #000000;
    font-size: 1.1rem;
    padding: 0 4rem;
    overflow: scroll;
}

.modal-content p {
    margin-top: 3rem;
}

/* Result text from API */
.result-text {
    margin-top: 3rem;
    line-height: 1.7;
    font-size: 1rem;
    color: #2c3e50;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.modal-content::-webkit-scrollbar {
    display: none;
}

/* Mobile Design - Media Queries */

/* Tablets and small laptops (max-width: 768px) */
@media screen and (max-width: 768px) {
    .content {
        padding: 1.5rem 1rem;
    }

    .survey-container {
        padding: 2rem 1.5rem;
        margin: 1rem auto;
    }

    h1 {
        font-size: 1.5rem;
        margin: 0 0 1.5rem 0;
    }

    .question-title {
        font-size: 1rem;
    }

    .radio-option span {
        font-size: 0.95rem;
    }

    .text-input {
        padding: 0.75rem;
        font-size: 0.95rem;
    }

    .submit-btn {
        font-size: 1rem;
        padding: 0.875rem 1.5rem;
        min-width: 160px;
    }

    .modal {
        width: 85%;
        height: 85%;
    }

    .modal-content {
        padding: 0 2rem;
        font-size: 1rem;
    }
}

/* Mobile phones (max-width: 480px) */
@media screen and (max-width: 480px) {
    .content {
        padding: 1rem 0.5rem;
    }

    .survey-container {
        padding: 1.5rem 1rem;
        margin: 0.5rem auto;
        border-radius: 8px;
    }

    h1 {
        font-size: 1.3rem;
        margin: 0 0 1.25rem 0;
    }

    .survey-form {
        gap: 1.5rem;
    }

    .question-block {
        gap: 0.75rem;
    }

    .question-title {
        font-size: 0.95rem;
        line-height: 1.4;
    }

    .radio-group {
        gap: 0.5rem;
        padding-left: 0.25rem;
    }

    .radio-option {
        padding: 0.625rem 0.5rem;
        gap: 0.5rem;
    }

    .radio-option input[type="radio"] {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }

    .radio-option span {
        font-size: 0.9rem;
        line-height: 1.3;
    }

    .text-input {
        padding: 0.625rem 0.75rem;
        font-size: 0.9rem;
    }

    .submit-btn {
        font-size: 0.95rem;
        padding: 0.75rem 1.25rem;
        min-width: 140px;
        height: 48px;
        width: 100%;
        max-width: 280px;
    }

    .modal {
        width: 95%;
        height: 90%;
        border-radius: 12px;
    }

    .modal-content {
        padding: 0 1.5rem;
        font-size: 0.95rem;
    }

    .modal-content p {
        margin-top: 2.5rem;
    }

    .close-btn {
        top: 0.75rem;
        right: 0.75rem;
        font-size: 1.75rem;
        width: 36px;
        height: 36px;
    }
}

/* Very small mobile phones (max-width: 360px) */
@media screen and (max-width: 360px) {
    .content {
        padding: 0.75rem 0.25rem;
    }

    .survey-container {
        padding: 1.25rem 0.75rem;
        border-radius: 6px;
    }

    h1 {
        font-size: 1.2rem;
        margin: 0 0 1rem 0;
    }

    .survey-form {
        gap: 1.25rem;
    }

    .question-title {
        font-size: 0.9rem;
    }

    .radio-option {
        padding: 0.5rem 0.375rem;
    }

    .radio-option input[type="radio"] {
        width: 16px;
        height: 16px;
    }

    .radio-option span {
        font-size: 0.85rem;
    }

    .text-input {
        padding: 0.5rem 0.625rem;
        font-size: 0.85rem;
    }

    .submit-btn {
        font-size: 0.9rem;
        padding: 0.625rem 1rem;
        min-width: 120px;
        height: 44px;
    }

    .modal {
        width: 98%;
        height: 92%;
    }

    .modal-content {
        padding: 0 1rem;
        font-size: 0.9rem;
    }

    .modal-content p {
        margin-top: 2rem;
    }

    .close-btn {
        top: 0.5rem;
        right: 0.5rem;
        font-size: 1.5rem;
        width: 32px;
        height: 32px;
    }
}

