/* ============================================
   CONTACT PAGE - Cosmic Communication Theme
   v2.0 - Radio Wave Animation + Smooth Transitions
   ============================================ */

/* --- CONTACT HERO SECTION --- */
.contact-hero-section {
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 120px 0 100px;
    /* Updated to match the key color to prevent any potential mismatch */
    background-color: #080912;
}

/* Hero Background - Hubble Earth Image */
.contact-nebula-bg {
    position: absolute;
    inset: 0;
    z-index: 0;

    background-image:
        /* Overlay for text readability - Stronger fade to matching color at bottom */
        linear-gradient(to bottom,
            rgba(5, 5, 8, 0.4) 0%,
            rgba(5, 5, 8, 0.3) 40%,
            rgba(5, 5, 8, 0.7) 80%,
            #080912 100%),
        /* Hero Image - Hubble Earth */
        /* Hero Image - Hubble Earth */
        url('../images/hero-images/s109e5706.webp');

    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

/* Hero to Content transition (Mask) */
.contact-hero-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 250px;
    /* Increased for even softer blend */
    background: linear-gradient(to bottom,
            transparent 0%,
            #080912 100%);
    pointer-events: none;
    z-index: 3;
}

/* Hero Content */
.contact-hero-content {
    position: relative;
    z-index: 5;
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.contact-hero-content h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    color: #fff;
    margin-bottom: var(--spacing-sm);
    font-weight: 700;
}

.contact-hero-content p {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.7;
    max-width: 600px;
    margin: 0 auto var(--spacing-lg);
}


/* ============================================
   RADIO WAVE ANIMATION - Horizontal Frequency Wave
   ============================================ */

/* Signal Animation Styles */
/* Signal Animation Styles */
.signal-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    /* Full width */
    height: 120px;
    margin-top: 40px;
    position: relative;
    overflow: hidden;
    /* Hide overflow if bars go beyond */
    /* Fading mask at edges for smooth integration */
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.signal-wave {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Spread bars across */
    width: 100%;
    min-width: 1000px;
    /* Ensure enough density */
    height: 100%;
    padding: 0 20px;
}

.signal-wave .bar {
    flex: 1;
    /* Grow to fill space */
    max-width: 4px;
    /* Maintain thin lines */
    margin: 0 2px;
    background: linear-gradient(to top, rgba(124, 58, 237, 0.2), #2dd4bf, rgba(124, 58, 237, 0.2));
    border-radius: 4px;
    animation: wave-frequency 2s ease-in-out infinite;
    height: 4px;
    /* Base height */
    opacity: 0.6;
}

/* 
   Creating a "sine wave" propagation effect using complex delays.
*/

@keyframes wave-frequency {

    0%,
    100% {
        height: 10px;
        opacity: 0.4;
        background: linear-gradient(to top, rgba(124, 58, 237, 0.2), #2dd4bf, rgba(124, 58, 237, 0.2));
    }

    50% {
        height: 80px;
        /* Max amplitude */
        opacity: 1;
        background: linear-gradient(to top, #7c3aed, #2dd4bf, #7c3aed);
        box-shadow: 0 0 15px rgba(45, 212, 191, 0.6);
    }
}

/* Procedural delays for a flowing wave effect */
/* We will target them in groups to create a ripple */
.signal-wave .bar:nth-child(5n+1) {
    animation-delay: 0.0s;
}

.signal-wave .bar:nth-child(5n+2) {
    animation-delay: 0.2s;
}

.signal-wave .bar:nth-child(5n+3) {
    animation-delay: 0.4s;
}

.signal-wave .bar:nth-child(5n+4) {
    animation-delay: 0.6s;
}

.signal-wave .bar:nth-child(5n+5) {
    animation-delay: 0.8s;
}

/* Add some randomness/noise to breaking the perfect sine wave for "voice/signal" look */
.signal-wave .bar:nth-child(7n) {
    animation-duration: 2.5s;
    height: 15px;
}

.signal-wave .bar:nth-child(11n) {
    animation-duration: 1.5s;
}


/* ============================================
   SECTION TRANSITIONS - Smooth Gradients
   ============================================ */

/* Hero to Content transition */
.contact-hero-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(to bottom,
            transparent 0%,
            #080912 100%);
    pointer-events: none;
    z-index: 3;
}

/* ============================================
   CONTACT CONTENT SECTION
   ============================================ */

.contact-content-section {
    position: relative;
    padding: 80px 0 100px;
    background: linear-gradient(180deg,
            #080912 0%,
            #0a0b16 50%,
            #080912 100%);
}

/* Hero to Content Gradient Mask (Footer-style technique) */
.contact-content-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 200px;
    background: linear-gradient(to bottom,
            #080912 0%,
            rgba(8, 9, 18, 0.7) 40%,
            transparent 100%);
    z-index: 2;
    pointer-events: none;
}

/* Content to Map transition */
.contact-content-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to bottom,
            transparent 0%,
            #080912 100%);
    pointer-events: none;
    z-index: 1;
}

.contact-bg-gradient {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 20%,
            rgba(45, 212, 191, 0.04) 0%,
            transparent 50%),
        radial-gradient(ellipse at 70% 80%,
            rgba(139, 92, 246, 0.04) 0%,
            transparent 50%);
    pointer-events: none;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 60px;
    position: relative;
    z-index: 5;
}

/* --- CONTACT INFO COLUMN --- */
.contact-info-column {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.contact-info-column h2 {
    font-size: 2rem;
    color: #fff;
    margin-bottom: var(--spacing-sm);
}

.contact-card {
    display: flex;
    gap: 20px;
    padding: 25px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-left: 2px solid rgba(45, 212, 191, 0.4);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.contact-card:hover {
    background: rgba(45, 212, 191, 0.05);
    border-left-color: #2dd4bf;
    transform: translateX(5px);
}

.contact-card-icon {
    font-size: 1.8rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(45, 212, 191, 0.1);
    border: 1px solid rgba(45, 212, 191, 0.2);
    clip-path: polygon(10% 0, 100% 0, 100% 90%, 90% 100%, 0 100%, 0 10%);
}

.contact-card-icon svg {
    stroke: #2dd4bf;
    filter: drop-shadow(0 0 4px rgba(45, 212, 191, 0.4));
    transition: all 0.3s ease;
}

.contact-card:hover .contact-card-icon svg {
    stroke: #fff;
    filter: drop-shadow(0 0 8px rgba(45, 212, 191, 0.8));
    transform: scale(1.1);
}

.contact-card-content h3 {
    font-size: 1.1rem;
    color: #2dd4bf;
    margin-bottom: 5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.contact-card-content p {
    color: #fff;
    font-size: 1rem;
    margin: 0;
}

.contact-card-content p a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-card-content p a:hover {
    color: #2dd4bf;
}

.contact-card-content .subtext {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 5px;
}

/* Social Links */
.contact-social {
    margin-top: 20px;
}

.contact-social h4 {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-link-cosmic {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link-cosmic:hover {
    background: rgba(45, 212, 191, 0.15);
    border-color: #2dd4bf;
    color: #2dd4bf;
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(45, 212, 191, 0.2);
}

.social-link-cosmic svg {
    stroke-width: 1.5px;
    transition: all 0.3s ease;
}

.social-link-cosmic:hover svg {
    stroke: #2dd4bf;
    stroke-width: 2px;
    filter: drop-shadow(0 0 4px rgba(45, 212, 191, 0.6));
}


/* ============================================
   CONTACT FORM
   ============================================ */

.contact-form-wrapper {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(15px);
    padding: 40px;
    position: relative;
}

/* Tech Corners */
.contact-form-wrapper::before,
.contact-form-wrapper::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    border-color: rgba(45, 212, 191, 0.4);
    border-style: solid;
    border-width: 0;
}

.contact-form-wrapper::before {
    top: -1px;
    left: -1px;
    border-top-width: 2px;
    border-left-width: 2px;
}

.contact-form-wrapper::after {
    bottom: -1px;
    right: -1px;
    border-bottom-width: 2px;
    border-right-width: 2px;
}

.form-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.form-icon {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
}

.form-icon svg {
    stroke: #2dd4bf;
    filter: drop-shadow(0 0 6px rgba(45, 212, 191, 0.5));
}

.form-header h3 {
    font-size: 1.4rem;
    color: #fff;
    margin: 0;
    font-weight: 600;
}

/* Form Type Toggle */
.form-type-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 25px;
    padding: 6px;
    background: rgba(5, 5, 8, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toggle-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    background: transparent;
    border: 1px solid transparent;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.95rem;
    font-weight: 500;
    font-family: 'Space Grotesk', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.03);
}

.toggle-btn.active {
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    border-color: rgba(45, 212, 191, 0.4);
    color: #2dd4bf;
}

.toggle-btn.active svg {
    stroke: #2dd4bf;
    filter: drop-shadow(0 0 4px rgba(45, 212, 191, 0.5));
}

.toggle-btn svg {
    transition: all 0.3s ease;
}

/* Form Fields Container */
.form-fields {
    display: none;
}

.form-fields.active {
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Honeypot Fields - Hidden from users and autofill */
.hp-field {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
    z-index: -1 !important;
}

.hp-field input {
    position: absolute !important;
    left: -9999px !important;
}

/* Form Status Messages */
.form-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 4px;
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.form-status.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.form-status.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.status-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.status-message {
    flex: 1;
}

/* Input Error State */
.cosmic-form input.error,
.cosmic-form select.error,
.cosmic-form textarea.error {
    border-color: rgba(239, 68, 68, 0.5) !important;
    background: rgba(239, 68, 68, 0.05) !important;
}

/* Loading Spinner */
.btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Form Elements */
.cosmic-form {
    display: flex;
    flex-direction: column;
    gap: 28px;
    position: relative;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 8px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    background: rgba(5, 5, 8, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px 18px;
    font-size: 1rem;
    color: #fff;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: rgba(45, 212, 191, 0.5);
    background: rgba(45, 212, 191, 0.05);
    box-shadow: 0 0 20px rgba(45, 212, 191, 0.1);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232dd4bf' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
}

.form-group select option {
    background: #0a0a12;
    color: #fff;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* Submit Button */
.submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 40px;
    background: linear-gradient(135deg,
            rgba(45, 212, 191, 0.2) 0%,
            rgba(139, 92, 246, 0.2) 100%);
    border: 1px solid rgba(45, 212, 191, 0.4);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Space Grotesk', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(45, 212, 191, 0.2),
            transparent);
    transition: left 0.5s ease;
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:hover {
    background: linear-gradient(135deg,
            rgba(45, 212, 191, 0.3) 0%,
            rgba(139, 92, 246, 0.3) 100%);
    border-color: #2dd4bf;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(45, 212, 191, 0.2);
}

.btn-icon {
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
}

.btn-icon svg {
    filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.5));
}

.submit-btn:hover .btn-icon {
    transform: translateX(5px);
}

/* ============================================
   MAP SECTION
   ============================================ */

.contact-map-section {
    position: relative;
    padding: 60px 0 80px;
    background: linear-gradient(180deg,
            #080912 0%,
            #0a0b16 50%,
            #080912 100%);
}

/* Map to Footer transition */
.contact-map-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom,
            transparent 0%,
            #080912 100%);
    pointer-events: none;
    z-index: 1;
}

.map-header {
    text-align: center;
    margin-bottom: 50px;
}

.map-header h2 {
    font-size: 2.5rem;
    color: #fff;
}

.map-wrapper {
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

/* Tech corner styling for map */
.map-wrapper::before,
.map-wrapper::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    border-color: rgba(45, 212, 191, 0.5);
    border-style: solid;
    border-width: 0;
    z-index: 10;
}

.map-wrapper::before {
    top: -1px;
    left: -1px;
    border-top-width: 2px;
    border-left-width: 2px;
}

.map-wrapper::after {
    bottom: -1px;
    right: -1px;
    border-bottom-width: 2px;
    border-right-width: 2px;
}

.map-placeholder {
    width: 100%;
    height: 400px;
    background: linear-gradient(135deg,
            rgba(45, 212, 191, 0.05) 0%,
            rgba(139, 92, 246, 0.05) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-overlay {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
}

.map-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 20px;
    opacity: 0.8;
}

.map-icon svg {
    stroke: #2dd4bf;
    filter: drop-shadow(0 0 15px rgba(45, 212, 191, 0.3));
    animation: floatMapIcon 3s ease-in-out infinite alternate;
}

@keyframes floatMapIcon {
    from {
        transform: translateY(0);
        filter: drop-shadow(0 0 15px rgba(45, 212, 191, 0.3));
    }

    to {
        transform: translateY(-10px);
        filter: drop-shadow(0 0 25px rgba(45, 212, 191, 0.6));
    }
}

.map-overlay p {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.map-overlay small {
    font-size: 0.9rem;
    opacity: 0.6;
}

/* Iframe styling when you add real map */
.map-wrapper iframe {
    width: 100%;
    height: 400px;
    border: none;
    filter: grayscale(80%) contrast(1.2);
    transition: filter 0.3s ease;
}

.map-wrapper:hover iframe {
    filter: grayscale(30%) contrast(1.1);
}


/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1024px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 50px;
    }

    .contact-info-column {
        order: 2;
    }

    .contact-form-column {
        order: 1;
    }

    .frequency-wrapper {
        max-width: 400px;
    }

    .freq-icon-left,
    .freq-icon-right {
        display: none;
    }

    .frequency-wrapper::before,
    .frequency-wrapper::after {
        display: none;
    }
}

@media (max-width: 768px) {
    .contact-hero-section {
        min-height: 50vh;
        padding: 100px 0 80px;
    }

    .contact-content-section {
        padding: 60px 0 80px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .contact-form-wrapper {
        padding: 25px;
    }

    .map-placeholder {
        height: 300px;
    }

    .frequency-bars {
        gap: 3px;
    }

    .freq-bar {
        width: 2px;
    }
}

@media (max-width: 480px) {
    .contact-hero-content h1 {
        font-size: 2rem;
    }

    .contact-card {
        flex-direction: column;
        text-align: center;
    }

    .contact-card-icon {
        margin: 0 auto;
    }

    .social-links {
        justify-content: center;
    }

    .frequency-bars {
        gap: 2px;
    }
}

/* ============================================
   CONTACT PAGE SPECIFIC FOOTER FIX
   ============================================ */
/* Ensure footer blends seamlessly with the map section */
.contact-footer-wrapper {
    background-color: #080912;
    position: relative;
    z-index: 5;
}

/* Adjust footer padding specifically for this page to match the longer mask */
.contact-footer-wrapper .nebula-footer {
    padding-top: 180px;
}

/* Gradient Mask for Smooth Entry */
.contact-footer-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    /* Increased to 300px per user request */
    height: 300px;
    background: linear-gradient(to bottom,
            #080912 0%,
            /* Less dark area: fade starts earlier */
            rgba(8, 9, 18, 0.7) 30%,
            transparent 100%);
    z-index: 10;
    pointer-events: none;
}