/* ========================================
   CONTACT MODAL STYLES
   ======================================== */

/* Modal Container */
.contact-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: flex-end;
    justify-content: center;
    padding: 24px 32px 28px;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.contact-modal.active {
    display: flex;
    opacity: 1;
}

/* Modal Overlay */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Modal Container */
.modal-container {
    position: relative;
    background: var(--bg-primary);
    border-radius: 24px 24px 0 0;
    width: 100%;
    max-width: 1100px;
    height: 82vh;
    max-height: 82vh;
    overflow: hidden;
    box-shadow: 
        0 -10px 60px rgba(0, 0, 0, 0.3),
        0 -4px 24px rgba(0, 0, 0, 0.2);
    z-index: 1;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
    border-bottom: none;
}

/* Top drag handle for visual polish */
.modal-container::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 56px;
    height: 6px;
    background: var(--border-color);
    border-radius: 999px;
    opacity: 0.9;
    pointer-events: none;
}

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

/* Dark mode adjustments */
[data-theme="dark"] .modal-container {
    background: var(--bg-primary-dark);
    border: 1px solid var(--border-color);
}

/* Close Button */
.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-secondary);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.modal-close:hover {
    background: var(--text-primary);
    color: var(--bg-primary);
    transform: rotate(90deg);
}

.modal-close:focus {
    outline: 3px solid var(--text-primary);
    outline-offset: 4px;
}

/* Dark mode close button */
[data-theme="dark"] .modal-close {
    background: #2a2a2a;
}

[data-theme="dark"] .modal-close:hover {
    background: #ffffff;
    color: #000000;
}

/* Modal Content */
.modal-content {
    padding: 40px 48px 32px;
    overflow-y: auto; /* allow scroll if content is taller */
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

/* Modal Header */
.modal-header {
    text-align: center;
    margin-bottom: 32px;
    width: 100%;
    max-width: 860px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.modal-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 400;
    line-height: 1.4;
}

/* Form Styles */
.modal-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 860px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.01em;
    margin-bottom: 4px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: clamp(10px, 0.9vw, 14px) clamp(14px, 1.2vw, 18px);
    font-size: clamp(0.95rem, 0.4vw + 0.9rem, 1.05rem);
    font-family: var(--font-family);
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    min-height: 44px; /* comfortable touch target */
}

/* Placeholder styling */
.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: var(--text-primary);
    background: var(--bg-primary);
    box-shadow: 
        0 0 0 3px rgba(0, 0, 0, 0.05),
        0 8px 20px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

/* Hover edge highlight */
.form-input:hover,
.form-textarea:hover,
.form-select:hover {
    border-color: color-mix(in oklab, var(--border-color) 70%, var(--text-primary));
}

.form-textarea {
    min-height: clamp(110px, 22vh, 160px);
    resize: vertical;
    font-family: var(--font-family);
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23000000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
    padding-right: 40px;
}

[data-theme="dark"] .form-select {
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Submit Button */
.modal-submit-btn {
    width: 100%;
    padding: clamp(14px, 1.2vw, 18px) clamp(24px, 2vw, 36px);
    background: var(--text-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: 16px;
    font-size: clamp(0.95rem, 0.4vw + 0.95rem, 1.1rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 8px;
    box-shadow: 
        0 8px 28px rgba(0, 0, 0, 0.16),
        0 4px 14px rgba(0, 0, 0, 0.1);
    min-height: 48px; /* comfortable touch target */
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}

.modal-submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 12px 32px rgba(0, 0, 0, 0.2),
        0 6px 16px rgba(0, 0, 0, 0.15);
}

.modal-submit-btn:active {
    transform: translateY(-1px);
}

.modal-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Dark mode submit button */
[data-theme="dark"] .modal-submit-btn {
    background: #ffffff;
    color: #000000;
}

.modal-submit-btn svg {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-submit-btn:hover svg {
    transform: translateX(4px);
}

/* Privacy Note */
.modal-privacy {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.privacy-link {
    color: var(--text-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: opacity 0.2s;
}

.privacy-link:hover {
    opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 992px) {
    .modal-container {
        max-width: 980px;
        height: 84vh;
        max-height: 84vh;
    }

    .modal-content {
        padding: 48px 48px 40px;
    }

    .modal-title {
        font-size: 2.4rem;
    }
}

@media (max-width: 768px) {
    .modal-container {
        border-radius: 20px 20px 0 0;
        height: 90vh;
        max-height: 90vh;
        max-width: 100%;
    }

    .modal-content {
        padding: 32px 28px 28px;
        align-items: stretch;
    }

    .modal-header {
        margin-bottom: 24px;
    }

    .modal-title {
        font-size: 1.85rem;
        margin-bottom: 8px;
    }

    .modal-subtitle {
        font-size: 1rem;
    }

    .modal-form {
        gap: 16px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .form-group {
        grid-column: 1 / -1;
    }

    .form-label {
        font-size: 0.85rem;
        margin-bottom: 6px;
    }

    .modal-close {
        top: 12px;
        right: 12px;
        width: 32px;
        height: 32px;
    }

    .modal-submit-btn {
        padding: clamp(12px, 2.5vw, 16px) clamp(20px, 4vw, 28px);
        font-size: clamp(0.95rem, 0.5vw + 0.9rem, 1.05rem);
        margin-top: 8px;
    }

    .modal-privacy {
        font-size: 0.8rem;
        margin-top: 12px;
    }
}

@media (max-width: 480px) {
    .contact-modal {
        padding: 12px;
    }

    .modal-container {
        border-radius: 16px 16px 0 0;
        height: 92vh;
        max-height: 92vh;
    }

    .modal-content {
        padding: 28px 20px 24px;
    }

    .modal-header {
        margin-bottom: 20px;
    }

    .modal-title {
        font-size: 1.6rem;
        margin-bottom: 6px;
    }

    .modal-subtitle {
        font-size: 0.9rem;
    }

    .modal-form {
        gap: 14px;
    }

    .form-row {
        gap: 14px;
    }

    .form-label {
        font-size: 0.8rem;
        margin-bottom: 4px;
    }

    .modal-submit-btn {
        padding: clamp(12px, 3.5vw, 14px) clamp(18px, 6vw, 24px);
        font-size: clamp(0.9rem, 1.5vw + 0.85rem, 1rem);
    }

    .form-input,
    .form-textarea,
    .form-select {
        padding: clamp(9px, 3vw, 12px) clamp(12px, 5vw, 16px);
        font-size: clamp(0.9rem, 1.5vw + 0.85rem, 1rem);
    }

    .form-textarea {
        min-height: 100px;
    }

    .modal-privacy {
        font-size: 0.75rem;
    }
}

/* Loading State */
.modal-submit-btn.loading {
    position: relative;
    color: transparent;
}

.modal-submit-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

[data-theme="dark"] .modal-submit-btn.loading::after {
    border-color: rgba(0, 0, 0, 0.3);
    border-top-color: #000000;
}

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

/* Success Message */
.modal-success {
    display: none;
    text-align: center;
    padding: 40px 32px;
}

.modal-success.active {
    display: block;
}

.modal-success-icon {
    width: 80px;
    height: 80px;
    background: var(--accent-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.modal-success-icon svg {
    width: 40px;
    height: 40px;
    color: #ffffff;
}

.modal-success h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 12px 0;
}

.modal-success p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin: 0 0 32px 0;
    line-height: 1.6;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .contact-modal,
    .modal-container,
    .modal-close,
    .modal-submit-btn {
        transition: none;
        animation: none;
    }
}

