/* Contact Page Specific Styles - Mobile First */

/* Contact Hero adjustments - Mobile First */
.contact-hero {
    min-height: 80vh;
    padding-top: 100px;
}

/* Contact Form Section - Mobile First */
.contact-form-section {
    padding: 4rem 0;
    background: var(--background);
}

.contact-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.contact-form-container {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
    order: 1;
}

.contact-form-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-secondary);
}

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

.form-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--text-primary); /* Fallback */
    line-height: 1.3;
}

.form-description {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Form Styles - Mobile First */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

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

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

.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-input,
.form-select,
.form-textarea {
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px; /* Prevents zoom on iOS */
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-medium);
    box-shadow: 0 0 0 3px rgba(45, 122, 95, 0.1);
    transform: scale(1.02);
}

.form-select {
    cursor: pointer;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23666" d="m0 0 2 2 2-2z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
    padding-right: 3rem;
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
    max-height: 300px;
}

/* Checkbox Styles - Mobile Optimized */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    line-height: 1.5;
    padding: 0.5rem;
    margin: -0.5rem;
    border-radius: 8px;
    -webkit-tap-highlight-color: transparent;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 22px;
    height: 22px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--gradient-secondary);
    border-color: var(--primary-medium);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.checkbox-text {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Form Actions - Mobile First */
.form-actions {
    margin-top: 1.5rem;
    text-align: center;
}

.form-submit {
    background: var(--gradient-secondary);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(45, 122, 95, 0.3);
    width: 100%;
    position: relative;
    overflow: hidden;
}

.form-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(45, 122, 95, 0.4);
}

.form-submit:active {
    transform: translateY(0);
}

.form-note {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-style: italic;
}

/* Contact Information - Mobile First */
.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    order: 2;
}

.info-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.25rem;
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-medium);
    -webkit-tap-highlight-color: rgba(45, 122, 95, 0.1);
}

.info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    border-left-color: var(--accent-yellow);
}

.info-icon {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
}

.info-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.info-content p {
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    line-height: 1.5;
    font-size: 0.9rem;
}

.info-content a {
    color: var(--primary-medium);
    text-decoration: none;
    transition: color 0.3s ease;
    word-break: break-word;
}

.info-content a:hover {
    color: var(--accent-yellow);
}

/* Response Times Section - Mobile First */
.response-section {
    padding: 4rem 0;
    background: var(--background-secondary);
}

.response-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 2rem;
}

.response-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.response-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-secondary);
}

.response-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.response-time {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    color: var(--primary-medium); /* Fallback */
}

.response-label {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.response-description {
    color: var(--text-secondary);
    line-height: 1.4;
    font-size: 0.85rem;
}

/* Office Hours Section - Mobile First */
.hours-section {
    padding: 4rem 0;
    background: var(--background);
}

.hours-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.hours-info {
    order: 1;
}

.hours-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--text-primary); /* Fallback */
    line-height: 1.3;
}

.hours-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    font-size: 0.95rem;
}

.timezone-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.timezone-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    border-left: 4px solid var(--primary-light);
    transition: all 0.3s ease;
}

.timezone-card:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.timezone-location {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.timezone-hours {
    color: var(--primary-medium);
    font-weight: 500;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
}

.timezone-response {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* Emergency Contact - Mobile First */
.emergency-contact {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-medium));
    color: white;
    border-radius: 20px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    order: 2;
}

.emergency-contact::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(45deg);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { transform: rotate(45deg) translateX(-100%); }
    50% { transform: rotate(45deg) translateX(100%); }
}

.emergency-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.emergency-title {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.3;
}

.emergency-badge {
    background: var(--accent-yellow);
    color: var(--primary-dark);
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    align-self: flex-start;
}

.emergency-description {
    margin-bottom: 1.5rem;
    line-height: 1.5;
    opacity: 0.9;
    font-size: 0.9rem;
}

.emergency-methods {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.emergency-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    text-decoration: none;
    font-weight: 600;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-size: 0.9rem;
}

.emergency-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(5px);
}

.emergency-icon {
    font-size: 1.1rem;
}

.emergency-notice {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    line-height: 1.4;
    backdrop-filter: blur(10px);
}

/* Form Validation Styles */
.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-error {
    color: #ef4444;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: none;
}

.form-error.show {
    display: block;
}

.form-success {
    background: #10b981;
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: none;
    font-size: 0.9rem;
}

.form-success.show {
    display: block;
}

/* Loading State */
.form-submit.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.form-submit.loading .submit-text {
    opacity: 0;
}

.form-submit.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Character Counter */
.character-counter {
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Tablet Responsive Design */
@media (min-width: 768px) {
    .contact-hero {
        min-height: 70vh;
        padding-top: 120px;
    }
    
    .contact-form-section {
        padding: 5rem 0;
    }
    
    .contact-layout {
        grid-template-columns: 2fr 1fr;
        gap: 3rem;
    }
    
    .contact-form-container {
        padding: 2.5rem;
        order: unset;
    }
    
    .contact-info {
        order: unset;
    }
    
    .form-title {
        font-size: 2rem;
    }
    
    .form-description {
        font-size: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        font-size: 1rem;
        padding: 1rem 1.25rem;
    }
    
    .form-submit {
        width: auto;
        padding: 1rem 2.5rem;
        font-size: 1.1rem;
    }
    
    .response-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .response-card {
        padding: 2rem;
        min-height: 160px;
    }
    
    .response-time {
        font-size: 2.5rem;
    }
    
    .response-label {
        font-size: 1.2rem;
    }
    
    .response-description {
        font-size: 0.95rem;
    }
    
    .hours-layout {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
    
    .hours-title {
        font-size: 2rem;
    }
    
    .hours-description {
        font-size: 1rem;
    }
    
    .timezone-card {
        padding: 1.25rem;
    }
    
    .timezone-location {
        font-size: 1rem;
    }
    
    .timezone-hours {
        font-size: 0.9rem;
    }
    
    .timezone-response {
        font-size: 0.85rem;
    }
    
    .emergency-contact {
        padding: 2rem;
    }
    
    .emergency-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .emergency-title {
        font-size: 1.5rem;
    }
    
    .emergency-description {
        font-size: 1rem;
    }
    
    .emergency-link {
        font-size: 1rem;
    }
    
    .emergency-notice {
        font-size: 0.9rem;
    }
}

/* Desktop Responsive Design */
@media (min-width: 1024px) {
    .contact-form-section {
        padding: 6rem 0;
    }
    
    .contact-layout {
        gap: 4rem;
    }
    
    .contact-form-container {
        padding: 3rem;
    }
    
    .form-header {
        margin-bottom: 2.5rem;
    }
    
    .response-section {
        padding: 6rem 0;
    }
    
    .response-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
    
    .hours-section {
        padding: 6rem 0;
    }
}

/* Large Desktop */
@media (min-width: 1200px) {
    .response-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* iOS Specific Fixes */
@supports (-webkit-touch-callout: none) {
    .form-input,
    .form-select,
    .form-textarea {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .contact-hero {
        min-height: -webkit-fill-available;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .info-card,
    .response-card,
    .timezone-card {
        border: 2px solid #333;
    }
    
    .emergency-contact {
        border: 2px solid white;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .info-card,
    .response-card,
    .timezone-card,
    .emergency-contact,
    .form-submit {
        transition: none;
    }
    
    .emergency-contact::before {
        animation: none;
    }
    
    .form-submit.loading::after {
        animation: none;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .info-card:hover,
    .response-card:hover,
    .timezone-card:hover {
        transform: none;
    }
    
    .emergency-link:hover {
        transform: none;
        background: rgba(255, 255, 255, 0.2);
    }
    
    .form-submit:hover {
        transform: none;
    }
}

/* Print styles */
@media print {
    .contact-hero,
    .emergency-contact {
        background: white !important;
        color: black !important;
    }
    
    .form-submit {
        display: none;
    }
    
    .contact-layout {
        grid-template-columns: 1fr;
    }
}