/* BSides Lunch Page Custom Styles */

.bsides-lunch-intro {
    background-color: #f8f9fa;
    padding: 60px 0;
    text-align: center;
}

.bsides-lunch-intro .firstsentence {
    color: #dc3545;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.bsides-lunch-intro .title {
    color: #212529;
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 20px;
}

.bsides-lunch-form {
    padding: 40px 0 60px 0; /* Removed side padding */
    background-color: #f0f4f7;
    min-height: auto;
    overflow: visible;
}

/* Ensure desktop version has proper height for form content */
@media (min-width: 769px) {
    .bsides-lunch-form {
        min-height: auto !important;
        max-height: none !important;
        height: auto !important;
        overflow: visible !important;
    }
}

.bsides-lunch-form .w-container {
    max-width: none !important; /* Override Hugo container max-width */
    width: 100% !important;
    max-width: 1200px;
    padding-left: 100px !important;
    padding-right: 100px !important;
}

.bsides-form-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0;
}

.bsides-form-container .hs-form-frame {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 40px 40px 80px 40px; /* Restore padding for desktop */
    width: 100%;
    margin: 0 auto;
    min-height: auto !important;
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
}

/* HubSpot form optimizations */
.bsides-form-container .hs-form-frame .hs-form fieldset {
    max-width: none !important;
    overflow: visible !important;
    height: auto !important;
    min-height: auto !important;
}

.bsides-form-container .hs-form-frame .hs-form .hs-form-field {
    margin-bottom: 20px;
}

.bsides-form-container .hs-form-frame .hs-form input,
.bsides-form-container .hs-form-frame .hs-form textarea,
.bsides-form-container .hs-form-frame .hs-form select {
    width: 100% !important;
    box-sizing: border-box;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

/* Fix form button styling and prevent cut-off */
.bsides-form-container .hs-form-frame .hs-form .hs-button,
.bsides-form-container .hs-form-frame .hs-form input[type="submit"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    width: auto !important;
    padding: 12px 20px !important;
    margin: 30px auto 30px auto !important;
    font-size: 16px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    clear: both !important;
    z-index: 999 !important;
    background-color: #007cba !important;
    color: white !important;
    border: none !important;
}

/* Additional button container fix */
.bsides-form-container .hs-form-frame .hs-form .hs-submit {
    overflow: visible !important;
    height: auto !important;
    min-height: 80px !important;
    padding: 20px 0 40px 0 !important;
    margin-bottom: 20px !important;
}

.bsides-form-container .hs-form-frame .hs-form .actions {
    overflow: visible !important;
    height: auto !important;
    min-height: 60px !important;
    padding-bottom: 20px !important;
}

/* Ensure the entire form has enough bottom space */
.bsides-form-container .hs-form-frame .hs-form {
    padding-bottom: 60px !important;
}

/* Force HubSpot iframe to expand properly */
.bsides-form-container .hs-form-frame iframe {
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    width: 100% !important;
}

/* Allow form frame to size naturally */
.bsides-form-container .hs-form-frame {
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .bsides-lunch-intro .title {
        font-size: 2em;
    }

    .bsides-lunch-form {
        padding: 30px 15px 50px 15px;
        min-height: calc(100vh - 200px); /* Account for header space */
        max-height: calc(100vh - 100px); /* Limit height to allow scrolling */
        overflow-y: auto; /* Enable vertical scrolling */
        position: relative;
    }

    .bsides-form-container {
        max-width: 100%;
        padding: 0 10px;
        height: auto;
        overflow: visible;
    }

    .bsides-form-container .hs-form-frame {
        padding: 25px 20px;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    /* Ensure HubSpot iframe is scrollable */
    .bsides-form-container .hs-form-frame iframe {
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }
}

@media (max-width: 480px) {
    .bsides-lunch-intro .title {
        font-size: 1.8em;
    }

    .bsides-lunch-intro {
        padding: 30px 0;
    }

    .bsides-lunch-form {
        padding: 20px 0 40px 0 !important; /* Remove side padding to prevent cutoff */
        min-height: calc(100vh - 150px); /* Account for header space */
        max-height: calc(100vh - 50px); /* Limit height to allow scrolling */
        overflow-y: auto; /* Enable vertical scrolling */
        position: relative;
    }

    .bsides-lunch-form .w-container {
        max-width: 100% !important;
        width: 100% !important;
        padding: 0 10px !important; /* Minimal padding for mobile */
        margin: 0 auto !important;
        box-sizing: border-box !important;
    }

    .bsides-form-container {
        padding: 0 !important;
        margin: 0 auto !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .bsides-form-container .hs-form-frame {
        padding: 15px 10px !important; /* Reduced padding to fit small screens */
        border-radius: 4px;
        margin: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .bsides-form-container .hs-form-frame .hs-form input,
    .bsides-form-container .hs-form-frame .hs-form textarea,
    .bsides-form-container .hs-form-frame .hs-form select {
        font-size: 16px !important; /* Prevent zoom on iOS */
        padding: 12px 8px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        max-width: 100% !important;
    }

    .bsides-form-container .hs-form-frame .hs-form .hs-button {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: auto !important;
        padding: 14px 20px !important;
        font-size: 16px !important;
        margin: 25px auto 25px auto !important;
    }

    /* Additional fixes for very small screens */
    .bsides-form-container .hs-form-frame .hs-form {
        width: 100% !important;
        max-width: none !important;
        overflow: visible !important;
    }

    .bsides-form-container .hs-form-frame .hs-form .hs-form-field {
        width: 100% !important;
        margin-bottom: 15px !important;
    }
}
