/* =========================================
   Integrated Contact Section for Click Solution
   Advanced Contact Form with Professional Design
   ========================================= */

/* =========================================
   1. Variables & Reset
   ========================================= */
:root {
    --primary-color: #1e3c72;           /* Primary blue from main site */
    --primary-dark: #1a3563;            /* Secondary blue from main site */
    --primary-light: #e3f2fd;           /* Light blue from main site */
    --accent-color: #64b5f6;            /* Accent blue from main site */
    --text-dark: #2c3e50;              /* Text dark from main site */
    --text-gray: #666666;              /* Text light from main site */
    --white: #ffffff;
    --border-color: #e9ecef;           /* Medium gray from main site */
    --shadow-sm: 0 5px 15px rgba(0, 0, 0, 0.08);    /* Shadow light from main site */
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.12);   /* Shadow medium from main site */
    --shadow-lg: 0 15px 40px rgba(0, 0, 0, 0.15);   /* Shadow dark from main site */
    --shadow-glow: 0 0 20px rgba(30, 60, 114, 0.15); /* Glow with primary color */
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s ease;        /* Using main site transition */
}

/* =========================================
   2. Background Elements
   ========================================= */
.advanced-contact-section {
    position: relative;
    padding: 100px 0;
    background: var(--white);
    overflow: hidden;
}

.contact-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.contact-grid-pattern {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(to right, rgba(30, 60, 114, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(30, 60, 114, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
}

.contact-floating-shapes {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.shape {
    position: absolute;
    background: linear-gradient(135deg, rgba(30, 60, 114, 0.1), rgba(100, 181, 246, 0.05));
    border-radius: 50%;
    filter: blur(40px);
    animation: float 20s infinite ease-in-out;
}

.shape-1 { width: 400px; height: 400px; top: -100px; right: -100px; animation-delay: 0s; }
.shape-2 { width: 300px; height: 300px; bottom: 10%; left: -50px; animation-delay: -5s; }
.shape-3 { width: 200px; height: 200px; top: 40%; right: 20%; animation-delay: -10s; }
.shape-4 { width: 150px; height: 150px; bottom: 20%; right: 40%; animation-delay: -15s; }

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* =========================================
   3. Layout & Typography
   ========================================= */
.advanced-contact-section .container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.contact-header {
    text-align: center;
    margin-bottom: 60px;
    animation: fadeInDown 0.8s ease-out;
}

.contact-subtitle {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 16px;
    background: var(--primary-light);
    padding: 8px 16px;
    border-radius: 50px;
    position: relative;
}

.contact-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 16px;
}

.highlight-main {
    color: var(--primary-color);
    position: relative;
    display: inline-block;
}

.highlight-main::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    height: 8px;
    background-color: rgba(100, 181, 246, 0.3);
    z-index: -1;
    border-radius: 4px;
}

.contact-description {
    color: var(--text-gray);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* =========================================
   4. Main Grid Layout
   ========================================= */
.contact-content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

@media (min-width: 992px) {
    .contact-content-grid {
        grid-template-columns: 350px 1fr;
        align-items: start;
    }
}

/* =========================================
   5. Info Cards (Left Side)
   ========================================= */
.info-cards-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.info-card {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    animation: fadeInRight 0.8s ease-out backwards;
}

.info-card:nth-child(1) { animation-delay: 0.1s; }
.info-card:nth-child(2) { animation-delay: 0.2s; }
.info-card:nth-child(3) { animation-delay: 0.3s; }
.info-card:nth-child(4) { animation-delay: 0.4s; }

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.info-card .card-inner {
    display: flex;
    align-items: center;
    gap: 15px;
}

.card-icon-wrapper {
    position: relative;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-background {
    width: 100%;
    height: 100%;
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: var(--transition);
    z-index: 2;
}

.info-card:hover .icon-background {
    background: var(--primary-color);
    color: var(--white);
    transform: rotateY(360deg);
}

.card-content h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-dark);
}

.card-content p {
    font-size: 0.9rem;
    color: var(--text-dark);
    font-weight: 500;
}

.card-label {
    font-size: 0.75rem;
    color: var(--text-gray);
    display: block;
    margin-top: 4px;
}

/* Map Section */
.map-section {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    animation: fadeInRight 0.8s ease-out 0.5s backwards;
}

.map-section h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: var(--text-dark);
    border-right: 4px solid var(--primary-color);
    padding-right: 12px;
}

.map-container {
    position: relative;
}

.map-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-md);
    margin-bottom: 15px;
}

.map-iframe {
    width: 100%;
    height: 250px;
    filter: grayscale(20%) contrast(1.1);
    transition: var(--transition);
}

.map-section:hover .map-iframe {
    filter: grayscale(0%);
}

.map-actions {
    display: flex;
    gap: 10px;
}

.map-btn {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.map-btn:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* =========================================
   6. Contact Form (Right Side)
   ========================================= */
.contact-form-section {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glow);
    border: 1px solid var(--border-color);
    animation: fadeInLeft 0.8s ease-out 0.3s backwards;
}

.form-header {
    margin-bottom: 30px;
    text-align: center;
}

.form-header h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.form-header p {
    color: var(--text-gray);
    font-size: 0.95rem;
}

/* Form Groups */
.click-form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 768px) {
    .click-form-row {
        grid-template-columns: 1fr 1fr;
    }
}

.click-form-group {
    margin-bottom: 20px;
    position: relative;
}

.click-form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dark);
}

.click-label-required { color: #ef4444; margin-right: 2px; }
.click-label-optional { color: var(--text-gray); font-size: 0.8rem; margin-right: 5px; }

/* Inputs Wrapper */
.click-input-wrapper,
.click-select-wrapper,
.click-textarea-wrapper {
    position: relative;
}

.click-form-input,
.click-form-select,
.click-form-textarea {
    width: 100%;
    padding: 12px 45px 12px 15px; /* Space for icon on right */
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.95rem;
    background: #fdfdfd;
    color: var(--text-dark);
    transition: var(--transition);
    appearance: none;
}

.click-input-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-gray);
    transition: var(--transition);
    pointer-events: none;
}

/* Focus States */
.click-form-input:focus,
.click-form-select:focus,
.click-form-textarea:focus {
    border-color: var(--primary-color);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(30, 60, 114, 0.1);
    outline: none;
}

.click-form-input:focus + .click-input-icon,
.click-form-select:focus + .click-select-border + .click-select-arrow + .click-input-icon,
.click-form-textarea:focus + .click-textarea-border + .click-char-counter + .click-input-icon {
    color: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

/* Select Specifics */
.click-select-arrow {
    position: absolute;
    right: 45px; /* Icon + padding */
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-gray);
    pointer-events: none;
    transition: var(--transition);
}

.click-select-wrapper:focus-within .click-select-arrow {
    transform: translateY(-50%) rotate(180deg);
    color: var(--primary-color);
}

/* Textarea Specifics */
.click-form-textarea {
    resize: vertical;
    min-height: 120px;
}

.click-char-counter {
    position: absolute;
    bottom: 10px;
    left: 15px;
    font-size: 0.75rem;
    color: var(--text-gray);
    background: var(--white);
    padding: 0 5px;
    border-radius: 4px;
}

/* Error States */
.click-input-error {
    display: none;
    color: #ef4444;
    font-size: 0.8rem;
    margin-top: 5px;
    animation: shake 0.4s ease-in-out;
}

.click-form-group.error .click-form-input,
.click-form-group.error .click-form-select,
.click-form-group.error .click-form-textarea {
    border-color: #ef4444;
    background: #fef2f2;
}

.click-form-group.error .click-input-error {
    display: block;
}

/* Checkbox */
.click-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-dark);
    user-select: none;
}

.click-checkbox-custom {
    position: relative;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    background: var(--white);
    flex-shrink: 0;
    transition: var(--transition);
    margin-top: 2px;
}

.click-checkbox-label input:checked + .click-checkbox-custom {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.click-checkbox-checkmark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    color: var(--white);
    font-size: 12px;
    transition: var(--transition);
}

.click-checkbox-label input:checked + .click-checkbox-custom .click-checkbox-checkmark {
    transform: translate(-50%, -50%) scale(1);
}

.click-privacy-link, .click-terms-link {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px dashed var(--primary-color);
}

.click-privacy-link:hover, .click-terms-link:hover {
    color: var(--primary-dark);
    border-bottom-style: solid;
}

/* =========================================
   7. Buttons
   ========================================= */
.click-form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.click-submit-btn,
.click-reset-btn {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

/* Submit Button */
.click-submit-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.click-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.click-submit-btn:active {
    transform: translateY(0);
}

.click-btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

/* Button States */
.click-btn-loading,
.click-btn-success {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: inherit;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.click-submit-btn.loading .click-btn-content { opacity: 0; }
.click-submit-btn.loading .click-btn-loading { opacity: 1; }

.click-submit-btn.success { background: #10b981; }
.click-submit-btn.success .click-btn-content { opacity: 0; }
.click-submit-btn.success .click-btn-success { opacity: 1; }

/* Reset Button */
.click-reset-btn {
    background: transparent;
    color: var(--text-gray);
    border: 1px solid var(--border-color);
}

.click-reset-btn:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
    border-color: var(--primary-color);
}

/* =========================================
   8. Modal (Success)
   ========================================= */
.click-success-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.click-success-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.click-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(5px);
}

.click-modal-content {
    position: relative;
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius-lg);
    text-align: center;
    max-width: 400px;
    width: 90%;
    transform: scale(0.8);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: var(--shadow-lg);
}

.click-success-modal.active .click-modal-content {
    transform: scale(1);
}

.click-modal-icon {
    width: 80px;
    height: 80px;
    background: #ecfdf5;
    color: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 20px;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.2s backwards;
}

.click-modal-content h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.click-modal-content p {
    color: var(--text-gray);
    margin-bottom: 25px;
}

.click-modal-close-btn {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.click-modal-close-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* =========================================
   9. Keyframe Animations
   ========================================= */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* =========================================
   10. Responsive Design
   ========================================= */
@media (max-width: 768px) {
    .advanced-contact-section {
        padding: 60px 0;
    }
    
    .contact-title {
        font-size: 2rem;
    }
    
    .contact-form-section {
        padding: 30px 20px;
    }
    
    .info-card {
        padding: 15px;
    }
    
    .card-icon-wrapper {
        width: 40px;
        height: 40px;
    }
    
    .icon-background {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .contact-content-grid {
        gap: 30px;
    }
    
    .click-form-actions {
        flex-direction: column;
    }
    
    .map-actions {
        flex-direction: column;
    }
}
