﻿/* Continue Button Styles */
.continue-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    transition: all 0.3s ease;
    display: none;
}

.continue-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
    background: linear-gradient(135deg, #218838, #1e9f92);
}

.continue-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(40, 167, 69, 0.4);
}

/* Modal Background Overlay */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Modal Content Container */
.modal-content {
    background-color: white;
    margin: 3% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal Header */
.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 30px;
    border-radius: 15px 15px 0 0;
    position: relative;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

    .modal-header h2 {
        margin: 0;
        font-size: 24px;
        font-weight: bold;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    }

/* Close Button */
.close {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    user-select: none;
}

    .close:hover {
        background-color: rgba(255, 255, 255, 0.2);
        transform: translateY(-50%) scale(1.1);
    }

    .close:active {
        transform: translateY(-50%) scale(0.95);
    }

/* Modal Body */
.modal-body {
    padding: 30px;
    background-color: #fafafa;
    border-radius: 0 0 15px 15px;
}

/* Form Groups */
.form-group {
    margin-bottom: 25px;
}

    .form-group label {
        display: block;
        margin-bottom: 8px;
        font-weight: 600;
        color: #333;
        font-size: 14px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

/* Form Inputs and Selects */
.form-input,
.modal-content input[type="text"],
.modal-content input[type="tel"],
.modal-content input[type="email"],
.modal-content select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background-color: white;
    font-family: inherit;
}

    .form-input:focus,
    .modal-content input:focus,
    .modal-content select:focus {
        outline: none;
        border-color: #667eea;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
        background-color: #fafcff;
    }

    .form-input:hover,
    .modal-content input:hover,
    .modal-content select:hover {
        border-color: #c1c9d0;
    }

/* Form Rows (side by side inputs) */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

    .form-row .form-group {
        flex: 1;
        margin-bottom: 0;
    }

/* Submit Button */
.modal-content button[type="submit"] {
    width: 100%;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 15px 20px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

    .modal-content button[type="submit"]:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
        background: linear-gradient(135deg, #218838, #1e9f92);
    }

    .modal-content button[type="submit"]:active {
        transform: translateY(0);
        box-shadow: 0 2px 10px rgba(40, 167, 69, 0.4);
    }

    .modal-content button[type="submit"]:disabled {
        background: #6c757d;
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
        opacity: 0.6;
    }

/* Select Arrow Styling */
.modal-content select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* Required Field Indicator */
.modal-content label:after {
    content: "";
}

.modal-content label:has(+ input[required]):after,
.modal-content label:has(+ select[required]):after {
    content: " *";
    color: #dc3545;
    font-weight: bold;
}

/* Form Validation Styles */
.modal-content input:invalid:not(:focus):not(:placeholder-shown) {
    border-color: #dc3545;
    background-color: #fff5f5;
}

.modal-content input:valid:not(:focus):not(:placeholder-shown) {
    border-color: #28a745;
    background-color: #f8fff8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 5% auto;
        max-height: 95vh;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-header {
        padding: 20px;
    }

        .modal-header h2 {
            font-size: 20px;
        }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

        .form-row .form-group {
            margin-bottom: 25px;
        }

    .modal-content input,
    .modal-content select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 98%;
        margin: 2% auto;
    }

    .modal-body {
        padding: 15px;
    }

    .modal-header {
        padding: 15px 20px;
    }

    .continue-btn {
        padding: 12px 24px;
        font-size: 16px;
    }
}

/* Smooth scrollbar for modal content */
.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

    .modal-content::-webkit-scrollbar-thumb:hover {
        background: #a8a8a8;
    }

/* Loading state for submit button */
.modal-content button[type="submit"].loading {
    position: relative;
    color: transparent;
}

    .modal-content button[type="submit"].loading:after {
        content: "";
        position: absolute;
        width: 20px;
        height: 20px;
        top: 50%;
        left: 50%;
        margin-left: -10px;
        margin-top: -10px;
        border: 2px solid #ffffff;
        border-radius: 50%;
        border-top-color: transparent;
        animation: spin 1s linear infinite;
    }

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Focus trap for accessibility */
.modal:focus-within {
    outline: none;
}

/* Animation for modal close */
.modal.closing {
    animation: fadeOut 0.3s ease-out;
}

    .modal.closing .modal-content {
        animation: slideOut 0.3s ease-out;
    }

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
}
