/* Contact Modal Specific Styles */
.contact-modal-content {
    max-width: 600px;
    padding: 0;
    overflow: hidden;
}

.contact-header {
    padding: 2rem;
    background: var(--gradient-1);
    color: white;
    text-align: center;
}

.contact-header h2 {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
}

.contact-header p {
    margin: 0;
    opacity: 0.9;
}

.contact-form {
    padding: 2rem;
}

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

.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 1rem;
    background: var(--dark-lighter);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-bright);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--dark);
}

/* Floating labels */
.form-group label {
    position: absolute;
    left: 1rem;
    top: 1rem;
    color: var(--text);
    transition: all 0.3s ease;
    pointer-events: none;
    background: var(--dark-lighter);
    padding: 0 0.5rem;
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group textarea:focus + label,
.form-group textarea:not(:placeholder-shown) + label {
    top: -0.5rem;
    left: 0.5rem;
    font-size: 0.85rem;
    color: var(--primary);
}

.form-group select {
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .modal {
        padding: 0; /* Remove padding on mobile */
        align-items: flex-start; /* Align to top on mobile */
    }

    .contact-modal-content {
        max-height: 100vh; /* Full height on mobile */
        max-width: 100%;
        border-radius: 0; /* Remove border radius on mobile */
        margin: 0;
    }

    .contact-header {
        padding: 1.5rem; /* Reduce padding */
    }

    .contact-form {
        padding: 1.5rem; /* Reduce padding */
    }

    /* Stack form fields on mobile */
    .form-row {
        grid-template-columns: 1fr; /* Single column on mobile */
        gap: 0; /* Remove gap between stacked items */
    }

    /* Ensure form groups have proper spacing when stacked */
    .form-group {
        margin-bottom: 1.5rem;
        width: 100%; /* Full width */
    }

    /* Larger touch targets on mobile */
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 1.2rem; /* Bigger touch target */
        font-size: 16px; /* Prevent zoom on iOS */
    }

    /* Adjust floating labels for mobile */
    .form-group label {
        font-size: 14px;
    }

    /* Stack buttons on mobile */
    .form-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .form-actions .btn {
        width: 100%; /* Full width buttons */
        padding: 1rem; /* Bigger touch target */
        text-align: center;
        align-items: center;
        justify-content: center;
    }
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Fix for iOS rubber band scrolling */
@supports (-webkit-touch-callout: none) {
    .modal {
        position: fixed;
        -webkit-overflow-scrolling: touch;
    }
}

/* Success state */
.form-success {
    padding: 3rem;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.form-success svg {
    margin-bottom: 1rem;
}

.form-success h3 {
    color: var(--accent);
    margin-bottom: 0.5rem;
}

/* Loading spinner for button */
.spinner-small {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Light theme adjustments */
[data-theme="light"] .form-group input,
[data-theme="light"] .form-group textarea,
[data-theme="light"] .form-group select {
    background: var(--light);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text);
}

[data-theme="light"] .form-group input:focus,
[data-theme="light"] .form-group textarea:focus,
[data-theme="light"] .form-group select:focus {
    background: white;
}

[data-theme="light"] .form-group label {
    background: var(--light);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .contact-modal-content {
        margin: 1rem;
        max-height: 90vh;
        overflow-y: auto;
    }
}