/* =========================================
   MODAL & LIGHTBOX STYLES
   ========================================= */

/* Base Modal (Hidden by default using HTML hidden attribute) */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal:not([hidden]) {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 767px) {
    #contact-modal.modal {
        align-items: flex-start;
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--color-white);
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
    z-index: 1010;
    transition: transform 0.2s;
}

.modal-close:hover, .modal-close:focus {
    transform: scale(1.1);
    color: var(--color-primary);
}

/* Lightbox Specifics */
.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.lightbox-caption {
    color: var(--color-white);
    margin-top: 10px;
    font-size: 1rem;
    text-align: center;
}

.lightbox-prev, .lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 2rem;
    padding: 1rem;
    cursor: pointer;
    z-index: 1010;
    border-radius: 4px;
    transition: background 0.2s;
}

.lightbox-prev:hover, .lightbox-next:hover,
.lightbox-prev:focus, .lightbox-next:focus {
    background: var(--color-primary);
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

/* Contact Modal Specifics */
.contact-modal-content {
    background: var(--color-white);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

@media (max-width: 767px) {
    .contact-modal-content {
        width: 100%;
        height: 100%;
        max-width: none;
        border-radius: 0;
        padding: 4rem 1.5rem 2rem 1.5rem;
        overflow-y: auto;
    }
}

.contact-modal-content .modal-close {
    color: var(--color-dark);
    top: 15px;
    right: 15px;
    font-size: 2rem;
}

@media (max-width: 767px) {
    .contact-modal-content .modal-close {
        top: 10px;
        right: 10px;
        background: #f1f1f1;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

.contact-modal-content .modal-close:hover {
    color: var(--color-primary);
}

#contact-title {
    margin-bottom: 0.5rem;
    color: var(--color-dark);
}

.contact-subtitle {
    margin-bottom: 1.5rem;
    color: var(--color-gray);
    font-size: 0.9rem;
    border-bottom: 1px solid #ddd;
    padding-bottom: 1rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: bold;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-group input, 
.form-group textarea {
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus, 
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(227, 30, 36, 0.2);
}

.error-msg {
    color: #cc0000;
    font-size: 0.8rem;
    margin-top: 0.4rem;
}

.form-group input:invalid:not(:focus):not(:placeholder-shown),
.form-group textarea:invalid:not(:focus):not(:placeholder-shown) {
    border-color: #cc0000;
}

.alert-success {
    background: #e6f4ea;
    color: #1e8e3e;
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
    font-weight: bold;
}

.alert-error {
    background: #fce8e6;
    color: #d93025;
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
    font-weight: bold;
}

/* Checkbox Styles */
.checkbox-group {
    margin-bottom: 1.5rem;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.85rem !important;
    font-weight: normal !important;
    cursor: pointer;
    line-height: 1.4;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 0.15rem;
    width: auto;
    cursor: pointer;
}

.checkbox-label a {
    color: var(--color-primary);
    text-decoration: underline;
}
