/* contact-form.css - Enhanced Professional Contact Form Styles */
/* Version: 2.0 - Clean, conflict-free implementation */

/* ================================
   Modal Foundation Styles
   ================================ */

.contact-form-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 15000; /* Higher than lightbox */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.contact-form-modal.active {
    opacity: 1;
    visibility: visible;
}

.contact-form-overlay {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow-y: auto;
}

.contact-form-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.contact-form-modal.active .contact-form-container {
    transform: scale(1);
}

/* ================================
   Header Styles
   ================================ */

.contact-form-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 2rem;
    border-radius: 16px 16px 0 0;
    position: relative;
}

.contact-form-header h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.8rem;
    font-weight: 600;
}

.contact-form-subtitle {
    margin: 0;
    font-size: 1rem;
    opacity: 0.9;
    line-height: 1.4;
}

.contact-form-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.contact-form-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* ================================
   Form Content Base Styles
   ================================ */

.contact-form-content {
    padding: 2rem;
}

.form-section {
    margin-bottom: 2rem;
}

.form-section:last-of-type {
    margin-bottom: 0;
}

.form-section h3 {
    color: #2c3e50;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 1.5rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.required {
    color: #e74c3c;
    font-weight: 700;
}

/* ================================
   Form Input Base Styles
   ================================ */

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.8rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    font-family: inherit;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2c3e50;
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
    transform: translateY(-1px);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

.form-group select {
    cursor: pointer;
}

/* ================================
   Artwork Info Section - Dark Theme
   ================================ */

.artwork-info-section {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border: 2px solid #5a6c7d;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.artwork-info-section h3 {
    color: #ecf0f1;
    border-bottom: 2px solid #3498db;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 1.5rem 0;
    padding-bottom: 0.5rem;
}

.artwork-info-section .form-group label {
    color: #bdc3c7;
    font-weight: 500;
}

.artwork-info-section .form-group input[readonly] {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    color: #ecf0f1;
    font-weight: 500;
    cursor: default;
    border: 2px solid #5a6c7d;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.artwork-info-section .form-group input[readonly]:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

/* ================================
   Enhanced Phone Input Styles
   ================================ */

.phone-input-container {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.country-code-input {
    flex: 0 0 80px;
    text-align: center;
    font-weight: 600;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    font-family: monospace;
    padding: 0.8rem 0.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.country-code-input:focus {
    border-color: #2c3e50;
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
    outline: none;
    transform: translateY(-1px);
}

.phone-number-input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: white;
}

.phone-number-input:focus {
    outline: none;
    border-color: #2c3e50;
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
    transform: translateY(-1px);
}

/* ================================
   Error Styles
   ================================ */

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
    border-color: #e74c3c;
    background: #fdf2f2;
}

.error-message {
    color: #e74c3c;
    font-size: 0.8rem;
    margin-top: 0.3rem;
    font-weight: 500;
}

/* ================================
   Button Styles
   ================================ */

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 2rem;
    border-top: 1px solid #e9ecef;
    margin-top: 2rem;
}

.btn-cancel,
.btn-submit {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.btn-cancel {
    background: #6c757d;
    color: white;
}

.btn-cancel:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.btn-submit {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
}

.btn-submit:hover {
    background: linear-gradient(135deg, #219a52 0%, #27ae60 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.btn-submit:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ================================
   Message Styles
   ================================ */

.form-message {
    margin: 1rem 2rem;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.form-message.show {
    opacity: 1;
    transform: translateY(0);
}

.form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ================================
   Hidden Shipping Method Section
   ================================ */

.form-group:has(#shippingMethod),
label[for="shippingMethod"] {
    display: none;
}

/* Fallback for browsers that don't support :has() */
.form-section .form-row:nth-child(2):has(select) {
    display: none;
}

/* ================================
   Animation Effects
   ================================ */

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    transform: translateY(-1px);
}

.btn-submit:disabled::after {
    content: '';
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.form-section {
    animation: fadeInUp 0.5s ease-out;
    animation-fill-mode: both;
}

.form-section:nth-child(1) { animation-delay: 0.1s; }
.form-section:nth-child(2) { animation-delay: 0.2s; }
.form-section:nth-child(3) { animation-delay: 0.3s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================================
   Scrollbar Styling
   ================================ */

.contact-form-container::-webkit-scrollbar {
    width: 6px;
}

.contact-form-container::-webkit-scrollbar-track {
    background: #f1f3f4;
    border-radius: 3px;
}

.contact-form-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.contact-form-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ================================
   Tablet Responsive Design
   ================================ */

@media (max-width: 768px) {
    .contact-form-overlay {
        padding: 1rem;
    }
    
    .contact-form-container {
        max-height: 95vh;
    }
    
    .contact-form-header {
        padding: 1.5rem;
    }
    
    .contact-form-header h2 {
        font-size: 1.5rem;
    }
    
    .contact-form-content {
        padding: 1.5rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-actions {
        flex-direction: column-reverse;
    }
    
    .btn-cancel,
    .btn-submit {
        width: 100%;
        margin: 0;
    }
    
    /* Phone input responsive */
    .phone-input-container {
        gap: 0.3rem;
    }
    
    .country-code-input {
        flex: 0 0 70px;
        font-size: 0.85rem;
        padding: 0.7rem 0.4rem;
    }
    
    .phone-number-input {
        font-size: 0.9rem;
        padding: 0.7rem 0.8rem;
    }
    
    /* Artwork section responsive */
    .artwork-info-section {
        margin-left: -1.5rem;
        margin-right: -1.5rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
}

/* ================================
   Mobile Phone Responsive Design
   ================================ */

@media (max-width: 480px) {
    .contact-form-overlay {
        padding: 0.5rem;
        align-items: flex-start;
        padding-top: 2rem;
    }
    
    .contact-form-container {
        max-height: 95vh;
        border-radius: 12px;
    }
    
    .contact-form-header {
        padding: 1rem;
        border-radius: 12px 12px 0 0;
    }
    
    .contact-form-header h2 {
        font-size: 1.3rem;
        margin-bottom: 0.3rem;
    }
    
    .contact-form-subtitle {
        font-size: 0.9rem;
    }
    
    .contact-form-close {
        top: 0.5rem;
        right: 0.5rem;
        width: 35px;
        height: 35px;
        font-size: 1.3rem;
    }
    
    .contact-form-content {
        padding: 1rem;
    }
    
    .form-section h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    .form-group label {
        font-size: 0.85rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.7rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .form-message {
        margin: 1rem;
        padding: 0.8rem;
        font-size: 0.9rem;
    }
    
    .form-actions {
        padding-top: 1.5rem;
        margin-top: 1.5rem;
    }
    
    .btn-cancel,
    .btn-submit {
        padding: 0.9rem 1.5rem;
        font-size: 0.9rem;
    }
    
    /* Ultra-compact phone input */
    .country-code-input {
        flex: 0 0 65px;
        font-size: 0.8rem;
        padding: 0.6rem 0.3rem;
    }
    
    .phone-number-input {
        padding: 0.7rem 0.6rem;
        font-size: 0.85rem;
    }
}

/* ================================
   Dark Mode Support (Optional)
   ================================ */

@media (prefers-color-scheme: dark) {
    .contact-form-container {
        background: #2c3e50;
        color: #ecf0f1;
    }
    
    .form-section h3 {
        color: #ecf0f1;
        border-bottom-color: #34495e;
    }
    
    .form-group label {
        color: #bdc3c7;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        background: #34495e;
        border-color: #4a5f7a;
        color: #ecf0f1;
    }
    
    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus {
        border-color: #3498db;
        box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    }
    
    .form-actions {
        border-top-color: #34495e;
    }
    
    /* Keep phone input light in dark mode for better UX */
    .country-code-input {
        background: #f8f9fa;
        color: #2c3e50;
    }
    
    .phone-number-input {
        background: white;
        color: #2c3e50;
    }
}

