/**
 * Contact Modal Styles
 * Boris Molinier Photographie - Professional Modal Form
 */

/* ================================
   Modal Overlay & Container
   ================================ */
.contact-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.contact-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.contact-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 13, 13, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.contact-modal__container {
    position: relative;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.contact-modal.is-open .contact-modal__container {
    transform: translateY(0);
}

.contact-modal__content {
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.98) 0%, rgba(18, 18, 18, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 2.5rem;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Mobile adjustments */
@media (max-width: 640px) {
    .contact-modal {
        padding: 0;
        align-items: flex-start;
    }

    .contact-modal__container {
        max-height: 100vh;
        border-radius: 0;
    }

    .contact-modal__content {
        padding: 1.5rem;
        min-height: 100vh;
        border-radius: 0;
    }
}

/* ================================
   Close Button
   ================================ */
.contact-modal__close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #c4c4c4;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 2;
}

.contact-modal__close:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: rgba(212, 175, 55, 0.3);
    color: #d4af37;
    transform: rotate(90deg);
}

/* ================================
   Header
   ================================ */
.contact-modal__header {
    margin-bottom: 2rem;
    padding-right: 3rem; /* Space for close button */
}

.contact-modal__title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 2rem;
    font-weight: 400;
    color: #f5f5f5;
    margin-bottom: 0.5rem;
}

.contact-modal__subtitle {
    font-size: 0.9375rem;
    font-weight: 300;
    color: #c4c4c4;
    line-height: 1.6;
}

/* ================================
   Form Layout
   ================================ */
.contact-modal__form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.contact-modal__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

@media (max-width: 640px) {
    .contact-modal__row {
        grid-template-columns: 1fr;
    }
}

.contact-modal__field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* ================================
   Form Elements
   ================================ */
.contact-modal__label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #c4c4c4;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.contact-modal__input,
.contact-modal__textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.9375rem;
    color: #f5f5f5;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    outline: none;
    transition: all 0.2s ease;
}

.contact-modal__input:focus,
.contact-modal__textarea:focus {
    background: rgba(255, 255, 255, 0.05);
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.contact-modal__input::placeholder,
.contact-modal__textarea::placeholder {
    color: #8a8a8a;
}

.contact-modal__textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

/* Select dropdown styling */
.contact-modal__input[type="select"],
select.contact-modal__input {
    cursor: pointer;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg width="12" height="8" viewBox="0 0 12 8" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L6 6L11 1" stroke="%23c4c4c4" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>');
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 3rem;
}

/* ================================
   Footer & Submit Button
   ================================ */
.contact-modal__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.5rem;
}

@media (max-width: 640px) {
    .contact-modal__footer {
        flex-direction: column;
        align-items: stretch;
    }
}

.contact-modal__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    padding: 1rem 2rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #0d0d0d;
    background: linear-gradient(135deg, #d4af37 0%, #f4d673 100%);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.contact-modal__submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.contact-modal__submit:active {
    transform: translateY(0);
}

.contact-modal__submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.contact-modal__submit-icon {
    transition: transform 0.2s ease;
}

.contact-modal__submit:hover .contact-modal__submit-icon {
    transform: translateX(4px);
}

/* Loading state */
.contact-modal__submit.is-loading .contact-modal__submit-text {
    opacity: 0;
}

.contact-modal__submit.is-loading .contact-modal__submit-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.contact-modal__note {
    font-size: 0.8125rem;
    color: #8a8a8a;
    margin: 0;
}

@media (max-width: 640px) {
    .contact-modal__note {
        text-align: center;
    }
}

/* ================================
   Success Message
   ================================ */
.contact-modal__success {
    text-align: center;
    padding: 3rem 1rem;
}

.contact-modal__success svg {
    margin-bottom: 1.5rem;
    animation: successPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes successPop {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.contact-modal__success h3 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.75rem;
    font-weight: 400;
    color: #f5f5f5;
    margin-bottom: 0.75rem;
}

.contact-modal__success p {
    font-size: 0.9375rem;
    color: #c4c4c4;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.contact-modal__success-close {
    padding: 0.875rem 2rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #f5f5f5;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.contact-modal__success-close:hover {
    border-color: #d4af37;
    color: #d4af37;
}

/* ================================
   Accessibility
   ================================ */
.contact-modal__input:invalid:not(:placeholder-shown) {
    border-color: #e74c3c;
}

.contact-modal__input:valid:not(:placeholder-shown) {
    border-color: rgba(46, 204, 113, 0.5);
}

@media (prefers-reduced-motion: reduce) {
    .contact-modal,
    .contact-modal__container,
    .contact-modal__submit,
    .contact-modal__close {
        transition: none;
        animation: none;
    }
}

/* Focus visible for keyboard navigation */
.contact-modal__input:focus-visible,
.contact-modal__textarea:focus-visible,
.contact-modal__submit:focus-visible,
.contact-modal__close:focus-visible {
    outline: 2px solid #d4af37;
    outline-offset: 2px;
}
