/**
 * JTM Booking Wizard Styles
 */

/* Wizard Container */
.jtm-booking-wizard {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    background: #fff;
    border-radius: var(--jtm-radius, 12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Progress Steps */
.jtm-wizard-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #eee;
    position: relative;
}

.jtm-wizard-progress::before {
    content: '';
    position: absolute;
    top: 18px;
    left: 10%;
    right: 10%;
    height: 3px;
    background: #e0e0e0;
    z-index: 0;
}

.jtm-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    flex: 1;
}

.jtm-step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.jtm-step-label {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #888;
    transition: color 0.3s ease;
}

.jtm-step.active .jtm-step-number {
    background: var(--jtm-primary, #0066cc);
    color: #fff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.jtm-step.active .jtm-step-label {
    color: var(--jtm-primary, #0066cc);
    font-weight: 600;
}

.jtm-step.completed .jtm-step-number {
    background: #22c55e;
    color: #fff;
}

.jtm-step.completed .jtm-step-label {
    color: #22c55e;
}

/* Wizard Steps */
.jtm-wizard-step h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
    color: #1f2937;
}

/* Events Grid */
.jtm-eventi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.jtm-evento-card {
    background: linear-gradient(145deg, #f8fafc, #f1f5f9);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s ease;
}

.jtm-evento-card:hover {
    border-color: var(--jtm-primary, #0066cc);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.jtm-evento-card h3 {
    margin: 0 0 1rem;
    font-size: 1.25rem;
    color: #1f2937;
}

.jtm-evento-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #64748b;
}

/* Companies Grid */
.jtm-search-box {
    margin-bottom: 1.5rem;
}

.jtm-search-box input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.jtm-search-box input:focus {
    outline: none;
    border-color: var(--jtm-primary, #0066cc);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.jtm-aziende-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.jtm-azienda-card {
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
}

.jtm-azienda-card:hover {
    border-color: var(--jtm-primary, #0066cc);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.jtm-azienda-logo {
    max-width: 100%;
    max-height: 100px;
    width: auto;
    height: auto;
    object-fit: contain;
    margin: 0 auto 1rem;
    border-radius: 8px;
    background: #f8fafc;
    padding: 8px;
    display: block;
}

.jtm-azienda-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    text-align: center;
}

.jtm-azienda-meta {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
}

.jtm-tag {
    background: #e0f2fe;
    color: #0369a1;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
}

.jtm-azienda-desc {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 1rem;
    flex-grow: 1;
    line-height: 1.5;
}

.jtm-azienda-card .jtm-button {
    margin-top: auto;
    width: 100%;
}

/* Slots Grid */
.jtm-selected-info {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    margin-bottom: 1.5rem;
    color: #166534;
}

.jtm-slots-grid {
    margin-bottom: 1.5rem;
}

.jtm-slots-day {
    margin-bottom: 1.5rem;
}

.jtm-slots-day h4 {
    margin: 0 0 0.75rem;
    color: #374151;
    font-size: 1rem;
    text-transform: capitalize;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.jtm-slot {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    margin: 0.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
}

.jtm-slot:hover:not([disabled]) {
    border-color: var(--jtm-primary, #0066cc);
    background: #eff6ff;
}

.jtm-slot.selected {
    background: var(--jtm-primary, #0066cc);
    color: #fff;
    border-color: var(--jtm-primary, #0066cc);
}

.jtm-slot-occupied {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
    border-color: #e2e8f0;
}

/* Form Styles */
.jtm-form-row {
    margin-bottom: 1.25rem;
}

.jtm-form-row label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.jtm-form-row input[type="text"],
.jtm-form-row input[type="email"],
.jtm-form-row input[type="tel"],
.jtm-form-row textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.jtm-form-row input:focus,
.jtm-form-row textarea:focus {
    outline: none;
    border-color: var(--jtm-primary, #0066cc);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.jtm-form-row small {
    display: block;
    margin-top: 0.25rem;
    color: #6b7280;
    font-size: 0.8rem;
}

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

.jtm-checkbox-label {
    display: flex !important;
    align-items: flex-start;
    gap: 0.5rem;
    font-weight: normal !important;
    cursor: pointer;
}

.jtm-checkbox-label input[type="checkbox"] {
    margin-top: 0.2rem;
    width: 18px;
    height: 18px;
}

/* Form Actions */
.jtm-form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

/* Summary */
.jtm-booking-summary {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
}

.jtm-summary-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e5e7eb;
    font-size: 1rem;
}

.jtm-summary-item:last-child {
    border-bottom: none;
}

.jtm-summary-item strong {
    color: #374151;
    margin-right: 0.5rem;
}

/* Success State */
.jtm-booking-success {
    text-align: center;
    padding: 3rem 2rem;
}

.jtm-success-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
}

.jtm-booking-success h2 {
    color: #16a34a;
    font-size: 2rem;
}

#jtm-success-details {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: left;
    display: inline-block;
    min-width: 300px;
}

#jtm-success-details p {
    margin: 0.5rem 0;
}

/* Company List */
.jtm-aziende-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.jtm-aziende-list .jtm-azienda-card {
    flex-direction: row;
    align-items: center;
    padding: 1.5rem;
}

.jtm-aziende-list .jtm-azienda-logo {
    margin: 0 1.5rem 0 0;
    flex-shrink: 0;
}

.jtm-azienda-content {
    flex-grow: 1;
}

.jtm-azienda-content h3 {
    text-align: left;
    margin-bottom: 0.5rem;
}

.jtm-azienda-content p {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
}

.jtm-aziende-list .jtm-azienda-meta {
    justify-content: flex-start;
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.jtm-aziende-list .jtm-button {
    flex-shrink: 0;
    margin-left: 1rem;
}

/* Loading State */
.jtm-loading {
    text-align: center;
    padding: 3rem;
    color: #64748b;
    font-size: 1.1rem;
}

.jtm-loading::before {
    content: '⏳';
    display: block;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Empty State */
.jtm-empty-state {
    text-align: center;
    padding: 3rem 2rem;
    background: #f8fafc;
    border-radius: 12px;
    color: #64748b;
}

/* Responsive */
@media (max-width: 768px) {
    .jtm-booking-wizard {
        padding: 1rem;
        margin: 0 -1rem;
        border-radius: 0;
    }

    .jtm-wizard-progress {
        overflow-x: auto;
        padding-bottom: 1rem;
    }

    .jtm-step-label {
        font-size: 0.7rem;
        display: none;
    }

    .jtm-step.active .jtm-step-label {
        display: block;
    }

    .jtm-form-row-half {
        grid-template-columns: 1fr;
    }

    .jtm-form-actions {
        flex-direction: column;
        gap: 1rem;
    }

    .jtm-form-actions .jtm-button {
        width: 100%;
    }

    .jtm-aziende-list .jtm-azienda-card {
        flex-direction: column;
        text-align: center;
    }

    .jtm-aziende-list .jtm-azienda-logo {
        margin: 0 0 1rem 0;
    }

    .jtm-aziende-list .jtm-button {
        width: 100%;
        margin: 1rem 0 0 0;
    }

    .jtm-azienda-content h3 {
        text-align: center;
    }

    .jtm-aziende-list .jtm-azienda-meta {
        justify-content: center;
    }
}

/* Position Info Button & Modal */
.jtm-posizione-item {
    position: relative;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    transition: border-color 0.2s;
}

.jtm-posizione-item:hover {
    border-color: #cbd5e1;
}

.jtm-pos-sede {
    display: block;
    font-size: 0.82rem;
    color: #64748b;
    margin-top: 4px;
    padding-left: 24px;
}

.jtm-pos-info-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #f0f7ff;
    border: 1px solid #dbeafe;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
}

.jtm-pos-info-btn:hover {
    background: #dbeafe;
    border-color: #93c5fd;
    transform: scale(1.1);
}

/* Position Detail Modal */
.jtm-pos-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.jtm-pos-modal-overlay.active {
    display: flex;
}

.jtm-pos-modal {
    background: #fff;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 32px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: jtmPosModalIn 0.25s ease;
}

@keyframes jtmPosModalIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.jtm-pos-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.jtm-pos-modal-close:hover {
    color: #333;
}

.jtm-pos-modal h3 {
    margin: 0 0 16px;
    font-size: 1.4rem;
    color: #1f2937;
}

.jtm-pos-modal-section {
    margin-bottom: 16px;
}

.jtm-pos-modal-section h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    margin: 0 0 6px;
    font-weight: 700;
}

.jtm-pos-modal-section p {
    margin: 0;
    color: #444;
    line-height: 1.6;
    font-size: 0.95rem;
}

.jtm-pos-modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}

.jtm-pos-mtag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 500;
}

.jtm-pos-istat-link {
    display: inline-block;
    margin-top: 12px;
    color: #0073aa;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.jtm-pos-istat-link:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .jtm-pos-modal {
        padding: 24px;
    }

    .jtm-pos-modal h3 {
        font-size: 1.2rem;
    }
}