/* Iframe-specific styles for WordPress integration */
/* These styles are applied when the form is detected to be in an iframe */

/* Detect iframe context and apply styles */
.iframe-mode {
    /* Reset full-height behavior */
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
}

.iframe-mode body {
    min-height: auto !important;
    height: auto !important;
    background: white;
}

.iframe-mode .form-container,
.iframe-mode .scheduling-container {
    height: auto !important;
    min-height: auto !important;
    max-width: none !important;
    width: 100%;
    padding: 0;
}

.iframe-mode .form-container {
    justify-content: flex-start;
    align-items: stretch;
}

/* Optimize form layout for iframe */
.iframe-mode .demo-form {
    max-width: 100%;
    padding: 0 20px;
    gap: 12px;
}

/* Scheduling container adjustments */
.iframe-mode .scheduling-container {
    display: block !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
}

/* Confirmation view adjustments */
.iframe-mode #confirmationView {
    height: auto !important;
    padding: 40px 20px;
    justify-content: flex-start;
    align-items: center;
}

.iframe-mode #studentInfoView {
    height: auto !important;
    padding: 40px 20px;
    justify-content: flex-start;
    align-items: center;
}

/* Calendar adjustments for iframe */
.iframe-mode .calendar {
    max-width: 100%;
}

.iframe-mode .time-slots {
    max-height: 300px;
    overflow-y: auto;
}

/* Compact spacing for iframe */
.iframe-mode .form-group {
    margin-bottom: 12px;
}

/* Button adjustments */
.iframe-mode .submit-btn,
.iframe-mode .confirm-booking {
    margin-top: 16px;
    margin-bottom: 8px;
}

/* Smooth transitions for view changes */
.iframe-mode [id$="Container"],
.iframe-mode [id$="View"] {
    transition: opacity 0.3s ease-in-out;
}

.iframe-mode [id$="Container"][style*="none"],
.iframe-mode [id$="View"][style*="none"] {
    display: none !important;
}

/* Loading states - removed iframe-specific loader styles as they're now in styles.css for universal use */

/* Error message spacing */
.iframe-mode .error-message {
    margin-top: 4px;
    margin-bottom: 8px;
}

/* Logo adjustments */
.iframe-mode .jove-logo {
    margin-bottom: 20px;
}

.iframe-mode .logo-circle {
    width: 48px;
    height: 48px;
}

.iframe-mode .logo-circle img {
    width: 40px !important;
}

/* Typography scaling */
.iframe-mode .schedule-title {
    font-size: 24px;
    margin-bottom: 20px;
}

.iframe-mode .confirmation-title {
    font-size: 28px;
}

.iframe-mode .info-modal-title {
    font-size: 24px;
} 

/* Desktop calendar styling moved below */

/* Responsive calendar display for iframe */

/* Desktop: Show desktop calendar, hide mobile */
@media (min-width: 768px) {
    .iframe-mode .desktop-calendar {
        display: flex !important;
        flex-direction: row;
        max-width: none;
        width: 100%;
    }

    .iframe-mode .mobile-calendar {
        display: none !important;
    }

    .iframe-mode .schedule-left-panel,
    .iframe-mode .schedule-right-panel {
        width: 50%;
        max-width: none;
        margin: 0;
        padding: 20px;
    }

    .iframe-mode .schedule-right-panel {
        border-left: 1px solid #e5e7eb;
        border-top: none;
        margin-top: 0;
        padding-top: 20px;
    }
}

/* Mobile: Use original mobile calendar behavior */
@media (max-width: 480px) {
    .iframe-mode .desktop-calendar {
        display: none !important;
    }

    .iframe-mode .mobile-calendar {
        display: block !important;
        padding: 20px;
        height: auto !important; /* Allow natural height */
    }

    /* Respect original mobile step behavior */
    .iframe-mode .mobile-date-step,
    .iframe-mode .mobile-time-step {
        display: none;
    }

    .iframe-mode .mobile-date-step.active,
    .iframe-mode .mobile-time-step.active {
        display: block !important;
    }

    /* Ensure mobile calendar color changes work */
    .iframe-mode .mobile-calendar.date-step-active {
        background-color: #0337e8;
        color: white;
    }

    .iframe-mode .mobile-calendar.time-step-active {
        background-color: white;
        color: #374151;
    }

    /* Ensure proper text colors */
    .iframe-mode .mobile-calendar.date-step-active .schedule-title,
    .iframe-mode .mobile-calendar.date-step-active .month-nav {
        color: white;
    }

    .iframe-mode .mobile-calendar.time-step-active .schedule-title,
    .iframe-mode .mobile-calendar.time-step-active .back-button {
        color: #374151;
    }
    .iframe-mode .time-selection .time-slots {
        max-height: 145px;
    }
    .iframe-mode .schedule-title {
        font-size: 20px;
        margin-bottom: 20px;
    }
    .iframe-mode #mobileCalendar {
        height: 100vh;
    }
}
