/* CSS Variables - Matching Landing Page */
:root {
    --primary-green: #1a5f5f;
    --primary-green-dark: #0d4a4a;
    --primary-green-light: #2a7a7a;
    --white: #ffffff;
    --cream: #fafafa;
    --text-dark: #1a1a1a;
    --text-grey: #4a4a4a;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.15);
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    font-family: 'Inter', sans-serif;
    background-color: var(--cream);
    color: var(--text-dark);
}

body {
    min-height: 100%;
    font-family: 'Inter', sans-serif;
    background-color: var(--cream);
    color: var(--text-dark);
    overflow-x: hidden;
    overflow-y: scroll; /* Always show scrollbar to prevent layout shift */
    -webkit-overflow-scrolling: touch;
}

/* Main Container */
.contact-container {
    position: relative;
    width: 100%;
    min-height: 100vh;
    min-height: calc(var(--vh, 1vh) * 100);
    display: flex;
    flex-direction: column;
}

/* Blurred Background */
.background-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/static/img/areal_shot_1.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
    filter: blur(8px);
    transform: scale(1.1);
}

.background-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(250, 250, 250, 0.3);
    z-index: 1;
}

/* Navbar */
.navbar {
    position: relative;
    width: 100%;
    padding: 1.5rem 4rem;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.navbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 20vh;
    background: linear-gradient(
        to bottom,
        rgba(250, 250, 250, 0.95) 0%,
        rgba(250, 250, 250, 0.85) 30%,
        rgba(250, 250, 250, 0.5) 60%,
        rgba(250, 250, 250, 0) 100%
    );
    pointer-events: none;
    z-index: -1;
}

/* Branding */
.branding {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.brand-icon {
    width: 40px;
    height: 40px;
    color: var(--primary-green);
    flex-shrink: 0;
}

.brand-icon svg {
    width: 100%;
    height: 100%;
}

.brand-name-container {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-green);
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--primary-green-light);
    letter-spacing: 0.3px;
    text-transform: uppercase;
    opacity: 0.8;
}

/* Main Content */
.main-content {
    position: relative;
    flex: 1 0 auto; /* Allow to grow but not shrink */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    padding: 2rem 4rem;
    width: 100%;
}

/* Unified Panel */
.unified-panel {
    width: 100%;
    max-width: 1200px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: row;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Gallery Section */
.gallery-section {
    flex: 0 0 45%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    background: linear-gradient(135deg, rgba(26, 95, 95, 0.02) 0%, rgba(42, 122, 122, 0.02) 100%);
}

.gallery-container {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    background-color: var(--white);
    border: 1px solid rgba(26, 95, 95, 0.1);
}

.gallery-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.gallery-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    cursor: pointer;
    pointer-events: none;
}

.gallery-image.active {
    opacity: 1;
    pointer-events: auto;
}

.gallery-image-wrapper:hover .gallery-image.active {
    opacity: 0.9;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.98) 100%);
    border: 1px solid rgba(26, 95, 95, 0.1);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    color: var(--primary-green);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
}

.gallery-nav:hover {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-light) 100%);
    color: var(--white);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(26, 95, 95, 0.4);
    border-color: transparent;
}

.gallery-nav:active {
    transform: translateY(-50%) scale(1.05);
}

.gallery-nav svg {
    width: 24px;
    height: 24px;
}

.gallery-nav-left {
    left: 1rem;
}

.gallery-nav-right {
    right: 1rem;
}

/* Form Section */
.form-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2.5rem;
    border-left: 1px solid rgba(26, 95, 95, 0.1);
    background: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(250, 250, 250, 1) 100%);
}

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

.form-title-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    justify-content: center;
}

.form-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-light) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    box-shadow: 0 4px 12px rgba(26, 95, 95, 0.3);
    flex-shrink: 0;
}

.form-icon svg {
    width: 24px;
    height: 24px;
}

.form-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-green);
    letter-spacing: -0.5px;
    margin: 0;
}

.form-subtitle {
    font-size: 1rem;
    color: var(--text-grey);
    line-height: 1.6;
    text-align: center;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-bottom: 0.5rem;
}

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

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

.form-group label {
    position: absolute;
    left: 1.125rem;
    top: 0.875rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-grey);
    pointer-events: none;
    transition: all 0.3s ease;
    background-color: var(--white);
    padding: 0 0.25rem;
    z-index: 1;
}

.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.875rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-green);
    background-color: var(--white);
}

.form-group input,
.form-group textarea {
    padding: 0.875rem 1.125rem;
    border: 2px solid rgba(26, 95, 95, 0.15);
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: var(--text-dark);
    background-color: var(--white);
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.form-group input:hover,
.form-group textarea:hover {
    border-color: rgba(26, 95, 95, 0.3);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 4px rgba(26, 95, 95, 0.1), 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}


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

.field-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-grey);
    margin-top: 0.35rem;
    line-height: 1.3;
}

.submit-btn {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-light) 100%);
    color: var(--white);
    border: none;
    padding: 1.125rem 2.5rem;
    font-family: 'Inter', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(26, 95, 95, 0.3);
    margin-top: 0.75rem;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(26, 95, 95, 0.4);
    background: linear-gradient(135deg, var(--primary-green-light) 0%, var(--primary-green) 100%);
}

.submit-btn:active:not(:disabled) {
    transform: translateY(-1px);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.form-message {
    padding: 1rem 1.25rem;
    border-radius: 10px;
    text-align: center;
    font-weight: 500;
    display: none;
    margin-top: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.form-message.success {
    display: block;
    background-color: rgba(26, 95, 95, 0.1);
    color: var(--primary-green);
    border: 1px solid var(--primary-green);
}

.form-message.error {
    display: block;
    background-color: rgba(220, 38, 38, 0.1);
    color: #dc2626;
    border: 1px solid #dc2626;
}

/* Responsive Design */
@media (max-width: 900px) {
    .contact-container {
        min-height: 100vh;
        min-height: calc(var(--vh, 1vh) * 100);
    }

    .navbar {
        padding: 1rem 2rem;
        flex-shrink: 0; /* Don't shrink navbar */
    }

    .brand-icon {
        width: 36px;
        height: 36px;
    }

    .brand-name {
        font-size: 1.25rem;
    }

    .brand-subtitle {
        font-size: 0.7rem;
    }

    .main-content {
        flex: 1 1 auto;
        min-height: 0;
        padding: 1rem 2rem 2rem;
        align-items: center;
        justify-content: center;
        overflow-y: auto;
    }

    .unified-panel {
        flex-direction: column;
        max-width: 100%;
    }

    .gallery-section {
        display: none;
    }

    .gallery-container {
        max-width: 100%;
    }

    .form-section {
        padding: 1.5rem;
        border-left: none;
        width: 100%;
    }

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

    .form-title-row {
        flex-direction: column;
        gap: 0.75rem;
    }

    .form-icon {
        width: 48px;
        height: 48px;
    }

    .form-icon svg {
        width: 24px;
        height: 24px;
    }

    .form-title {
        font-size: 1.75rem;
    }

    .form-subtitle {
        font-size: 0.95rem;
    }

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

@media (max-width: 600px) {
    .navbar {
        padding: 0.75rem 1rem;
    }

    .branding {
        gap: 0.75rem;
    }

    .brand-icon {
        width: 32px;
        height: 32px;
    }

    .brand-name {
        font-size: 1.1rem;
    }

    .brand-subtitle {
        font-size: 0.65rem;
    }

    .main-content {
        flex: 1 1 auto;
        min-height: 0;
        padding: 0.75rem 1rem 1.5rem;
        align-items: center;
        justify-content: center;
        overflow-y: auto;
    }

    .unified-panel {
        max-width: 100%;
    }

    .gallery-section {
        display: none;
    }

    .gallery-container {
        aspect-ratio: 16 / 9;
    }

    .form-section {
        padding: 1.25rem;
        border-left: none;
        width: 100%;
    }

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

    .form-title-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .form-icon {
        width: 40px;
        height: 40px;
    }

    .form-icon svg {
        width: 20px;
        height: 20px;
    }

    .form-title {
        font-size: 1.5rem;
    }

    .form-subtitle {
        font-size: 0.9rem;
    }

    .contact-form {
        gap: 1rem;
    }

    .form-row {
        gap: 1rem;
    }
    
    .submit-btn {
        margin-top: 0.5rem;
        padding: 0.875rem 1.5rem;
    }

    .gallery-nav {
        width: 40px;
        height: 40px;
    }

    .gallery-nav svg {
        width: 20px;
        height: 20px;
    }
}

/* Landscape mode on mobile - extra compact */
@media (max-height: 500px) and (orientation: landscape) {
    .navbar {
        padding: 0.5rem 1rem;
    }

    .navbar::before {
        height: 15vh;
    }

    .brand-icon {
        width: 28px;
        height: 28px;
    }

    .brand-name {
        font-size: 1rem;
    }

    .brand-subtitle {
        font-size: 0.6rem;
    }

    .main-content {
        flex: 1 1 auto;
        min-height: 0;
        padding: 0.5rem 1rem 1rem;
        align-items: center;
        justify-content: center;
        overflow-y: auto;
    }

    .form-section {
        padding: 1rem;
    }

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

    .form-title-row {
        flex-direction: row;
        gap: 0.75rem;
    }

    .form-icon {
        width: 32px;
        height: 32px;
    }

    .form-icon svg {
        width: 16px;
        height: 16px;
    }

    .form-title {
        font-size: 1.25rem;
    }

    .form-subtitle {
        font-size: 0.8rem;
    }

    .contact-form {
        gap: 0.75rem;
    }

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

    .form-group label {
        font-size: 0.85rem;
        top: 0.6rem;
        left: 0.875rem;
    }

    .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.4rem;
        font-size: 0.65rem;
    }

    .form-group input,
    .form-group textarea {
        padding: 0.625rem 0.875rem;
        font-size: 0.9rem;
    }

    .form-group textarea {
        min-height: 60px;
    }

    .submit-btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
        margin-top: 0.25rem;
    }
}

/* Fullscreen Modal */
.fullscreen-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.fullscreen-modal.active {
    display: flex;
}

.fullscreen-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    cursor: default;
}

.fullscreen-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
    color: var(--primary-green);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.fullscreen-close:hover {
    background: var(--white);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.fullscreen-close svg {
    width: 24px;
    height: 24px;
}

.fullscreen-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
    color: var(--primary-green);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.fullscreen-nav:hover {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-light) 100%);
    color: var(--white);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(26, 95, 95, 0.4);
}

.fullscreen-nav svg {
    width: 28px;
    height: 28px;
}

.fullscreen-prev {
    left: 2rem;
}

.fullscreen-next {
    right: 2rem;
}

@media (max-width: 600px) {
    .fullscreen-close {
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
    }

    .fullscreen-close svg {
        width: 20px;
        height: 20px;
    }

    .fullscreen-nav {
        width: 48px;
        height: 48px;
    }

    .fullscreen-nav svg {
        width: 24px;
        height: 24px;
    }

    .fullscreen-prev {
        left: 1rem;
    }

    .fullscreen-next {
        right: 1rem;
    }

    .fullscreen-image {
        max-width: 95%;
        max-height: 95%;
    }
}
