/* OpenDay Booking - Frontend Styles */

.openday-booking-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    transition: all 0.4s ease;
}

/* Full width for step 4 (embed calendar) */
.openday-booking-container.openday-full-width {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

.openday-title {
    text-align: center;
    font-size: 2.2em;
    margin-bottom: 20px;
    color: #1a1a1a;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Progress Bar */
.openday-progress-bar {
    margin-bottom: 50px;
    padding: 0 20px;
}

.openday-progress-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 600px;
    margin: 0 auto;
}

.openday-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

.openday-progress-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    transition: all 0.3s ease;
    border: 3px solid #e0e0e0;
}

.openday-progress-step.active .openday-progress-number {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
    box-shadow: 0 0 0 4px rgba(0, 115, 170, 0.1);
    transform: scale(1.1);
}

.openday-progress-step.completed .openday-progress-number {
    background: #28a745;
    color: #fff;
    border-color: #28a745;
}

.openday-progress-label {
    margin-top: 10px;
    font-size: 0.85em;
    color: #999;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
}

.openday-progress-step.active .openday-progress-label {
    color: #0073aa;
    font-weight: 600;
}

.openday-progress-step.completed .openday-progress-label {
    color: #28a745;
}

.openday-progress-line {
    flex: 1;
    height: 3px;
    background: #e0e0e0;
    margin: 0 10px;
    margin-top: -25px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 0;
}

.openday-progress-line.completed {
    background: #28a745;
}

.openday-step {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.openday-step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.openday-step-title {
    font-size: 1.5em;
    margin-bottom: 30px;
    text-align: center;
    color: #444;
}

.openday-corsi-section {
    margin-bottom: 40px;
}

.openday-section-title {
    font-size: 1.2em;
    margin-bottom: 20px;
    color: #555;
    font-weight: 600;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.openday-corsi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .openday-corsi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .openday-corsi-grid {
        grid-template-columns: 1fr;
    }
}

.openday-corso-btn {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px 15px;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #333;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.openday-corso-btn:hover {
    border-color: #0073aa;
    background: #f0f8ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.openday-corso-btn:active {
    transform: translateY(0);
}

.openday-corso-btn.active {
    border-color: #0073aa;
    background: #0073aa;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

/* Card Mode Styles */
.openday-corso-card {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    position: relative;
    outline: none;
}

.openday-corso-card:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.openday-corso-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border-color: #0073aa;
}

.openday-corso-card.active {
    border-color: #0073aa;
    box-shadow: 0 8px 24px rgba(0, 115, 170, 0.3);
}

.openday-card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
    background: #f0f0f0;
}

.openday-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.openday-corso-card:hover .openday-card-image img {
    transform: scale(1.05);
}

.openday-card-content {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    min-width: 0;
}

.openday-card-title {
    font-size: 0.95em;
    font-weight: 600;
    color: #333;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.openday-card-arrow {
    color: #666;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-left: 12px;
}

.openday-corso-card:hover .openday-card-arrow {
    color: #0073aa;
    transform: translateX(4px);
}

.openday-corso-card.active .openday-card-arrow {
    color: #0073aa;
}

/* Empty card for layout spacing */
.openday-empty-card {
    visibility: hidden;
    pointer-events: none;
    height: 0;
    min-height: 0;
}

.openday-corsi-grid.openday-cards-mode .openday-empty-card {
    height: auto;
    min-height: 200px;
    background: transparent;
    border: none;
    visibility: visible;
}

.openday-modalita-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.openday-modalita-btn {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 40px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    outline: none;
}

.openday-modalita-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.openday-modalita-btn:hover {
    border-color: #0073aa;
    background: #f0f8ff;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.openday-modalita-btn.active {
    border-color: #0073aa;
    background: #0073aa;
    color: #fff;
    box-shadow: 0 6px 12px rgba(0, 115, 170, 0.3);
}

.openday-modalita-btn.active .openday-modalita-label {
    color: #fff;
}

.openday-modalita-icon {
    font-size: 3em;
}

.openday-modalita-label {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
}

.openday-back-btn {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px 24px;
    cursor: pointer;
    font-size: 0.95em;
    color: #666;
    transition: all 0.2s ease;
    font-weight: 500;
    outline: none;
}

.openday-back-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.openday-back-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
    color: #333;
    transform: translateX(-3px);
}

.openday-summary {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid #e0e0e0;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.openday-summary-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    margin-bottom: 15px;
    border: 1px solid #e8e8e8;
    transition: all 0.3s ease;
}

.openday-summary-item:last-child {
    margin-bottom: 0;
}

.openday-summary-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.openday-summary-icon {
    font-size: 2.5em;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f8ff;
    border-radius: 12px;
    flex-shrink: 0;
}

.openday-summary-content {
    flex: 1;
}

.openday-summary-label {
    font-size: 0.85em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 5px;
}

.openday-summary-value {
    font-size: 1.2em;
    color: #1a1a1a;
    font-weight: 600;
}

.openday-edit-btn {
    background: transparent;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    outline: none;
}

.openday-edit-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.openday-edit-btn:hover {
    border-color: #0073aa;
    color: #0073aa;
    background: #f0f8ff;
    transform: scale(1.05);
}

.openday-edit-btn svg {
    width: 18px;
    height: 18px;
}

.openday-action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.openday-confirm-btn {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px 24px;
    cursor: pointer;
    font-size: 0.95em;
    color: #666;
    transition: all 0.2s ease;
    font-weight: 500;
    outline: none;
    display: flex;
    align-items: center;
    gap: 8px;
}


.openday-confirm-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
    color: #333;
    transform: translateX(3px);
}

.openday-confirm-btn:active {
    transform: translateX(0);
}

.openday-confirm-btn svg {
    transition: transform 0.2s ease;
    flex-shrink: 0;
    vertical-align: middle;
}

.openday-confirm-btn:hover svg {
    transform: translateX(4px);
}

.openday-confirm-btn span {
    display: inline-flex;
    align-items: center;
}

.openday-confirm-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.openday-loading {
    text-align: center;
    padding: 40px 20px;
    margin-top: 30px;
}

/* Embed Container */
.openday-embed-container {
    width: 100%;
    min-height: 600px;
    margin: 0;
    border-radius: 0;
    overflow: visible;
    background: transparent;
    border: none;
    position: relative;
}

.openday-embed-container iframe {
    width: 100%;
    min-height: 600px;
    border: none;
    display: block;
    background: #fff;
}

.openday-step-4 {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

.openday-step-4 .openday-step-title {
    margin-bottom: 20px;
    padding: 20px;
    text-align: center;
    background: #fff;
}

.openday-step-4 .openday-embed-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 0 !important;
}

.openday-step-4 .openday-embed-container iframe {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 700px !important;
}

.openday-step-4 .openday-action-buttons {
    padding: 20px;
    margin-top: 30px;
    background: #fff;
    text-align: center;
}

/* Desktop: limit max-width to 1060px for step 4 */
@media (min-width: 1061px) {
    .openday-booking-container.openday-full-width {
        max-width: 1060px !important;
        margin: 0 auto !important;
    }
    
    .openday-step-4 .openday-embed-container {
        max-width: 1060px !important;
    }
    
    .openday-step-4 .openday-embed-container iframe {
        max-width: 1060px !important;
    }
}

.openday-loading p {
    font-size: 1.1em;
    color: #666;
    margin-top: 20px;
    font-weight: 500;
}

.openday-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.openday-error-message {
    background: #fee;
    border: 2px solid #fcc;
    border-radius: 8px;
    padding: 15px 20px;
    margin: 20px 0;
    color: #c33;
    text-align: center;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .openday-booking-container {
        padding: 20px 15px;
    }
    
    .openday-title {
        font-size: 1.8em;
        margin-bottom: 30px;
    }
    
    .openday-progress-bar {
        margin-bottom: 30px;
        padding: 0 10px;
    }
    
    .openday-progress-number {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .openday-progress-label {
        font-size: 0.75em;
        margin-top: 8px;
    }
    
    .openday-progress-line {
        margin-top: -22px;
    }
    
    .openday-corsi-grid {
        grid-template-columns: 1fr;
    }
    
    .openday-corsi-grid.openday-cards-mode {
        grid-template-columns: 1fr;
    }
    
    .openday-modalita-grid {
        grid-template-columns: 1fr;
    }
    
    .openday-summary {
        padding: 20px;
    }
    
    .openday-summary-item {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }
    
    .openday-summary-icon {
        width: 50px;
        height: 50px;
        font-size: 2em;
    }
    
    .openday-action-buttons {
        flex-direction: column;
    }
    
    .openday-confirm-btn,
    .openday-back-btn {
        width: 100%;
        justify-content: center;
    }
}

