/**
 * Opus Dental Booking Styles
 */

/* Global box-sizing for booking widget */
.opus-booking-container *,
.opus-booking-container *::before,
.opus-booking-container *::after {
    box-sizing: border-box;
}

.opus-booking-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    box-sizing: border-box;
}

/* Mobile optimization */
@media (max-width: 768px) {
    .opus-booking-container {
        padding: 10px;
        max-width: 100%;
        width: 100%;
        overflow-x: hidden;
    }
}

/* Steps */
.opus-step {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .opus-step {
        padding: 15px;
        border-radius: 6px;
        margin-bottom: 15px;
    }
}

.opus-step-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #1a202c;
}

.opus-back-btn {
    display: inline-block;
    color: #4299e1;
    cursor: pointer;
    margin-bottom: 20px;
    font-size: 14px;
    transition: color 0.2s;
}

.opus-back-btn:hover {
    color: #2b6cb0;
}

/* Loading */
.opus-loading {
    text-align: center;
    padding: 40px;
}

.opus-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top-color: #4299e1;
    border-radius: 50%;
    animation: opus-spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes opus-spin {
    to { transform: rotate(360deg); }
}

/* Treatment Cards */
.opus-category {
    margin-bottom: 30px;
}

.opus-category-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #2d3748;
}

.opus-treatment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

@media (max-width: 768px) {
    .opus-treatment-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

.opus-treatment-card {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.opus-treatment-card:hover {
    border-color: #4299e1;
    background: #ebf8ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.15);
}

.opus-treatment-card h5 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1a202c;
}

.opus-treatment-desc {
    font-size: 14px;
    color: #718096;
    margin-bottom: 12px;
    line-height: 1.5;
}

.opus-treatment-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.opus-duration {
    color: #718096;
}

.opus-price {
    font-weight: 600;
    color: #2d3748;
}

/* Practitioner Cards */
.opus-practitioner-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    box-sizing: border-box;
    width: 100%;
}

.opus-practitioner-card:hover {
    border-color: #0C71C3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(12, 113, 195, 0.1);
}

.opus-practitioner-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.opus-practitioner-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #e2e8f0;
    flex-shrink: 0;
}

.opus-practitioner-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.opus-practitioner-card:hover .opus-practitioner-avatar {
    border-color: #0C71C3;
}

.opus-avatar-placeholder {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #f0f0f0;
    border: 3px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: #9ca3af;
    flex-shrink: 0;
}

.opus-practitioner-card:hover .opus-avatar-placeholder {
    border-color: #0C71C3;
    background: #f7fafc;
}

.opus-practitioner-details {
    flex: 1;
    min-width: 0;
}

.opus-practitioner-details h5 {
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: #1a202c;
    font-family: 'Montserrat', Arial, sans-serif;
}

.opus-practitioner-title {
    font-size: 14px;
    color: #4a5568;
    margin: 0 0 4px 0;
}

.opus-practitioner-languages {
    font-size: 13px;
    color: #718096;
    margin: 0;
}

.opus-practitioner-highlight {
    font-size: 13px;
    color: #0C71C3;
    font-weight: 500;
    margin: 4px 0 0 0;
}

.opus-select-btn {
    background: #0C71C3;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Montserrat', Arial, sans-serif;
    white-space: nowrap;
}

.opus-select-btn:hover {
    background: #0a5fa5;
    transform: translateY(-1px);
}

.opus-any-practitioner {
    background: #f0f8ff;
    border-color: #0C71C3;
    margin-bottom: 25px;
}

.opus-any-practitioner:hover {
    background: #e6f3ff;
}

.opus-any-avatar {
    background: #e6f3ff !important;
    border-color: #0C71C3 !important;
}

.opus-select-any {
    background: #0C71C3;
}

.opus-select-any:hover {
    background: #0a5fa5;
}

/* Responsive design for practitioner cards */
@media (max-width: 768px) {
    .opus-practitioner-card {
        flex-direction: column;
        text-align: center;
        padding: 15px;
        margin-left: 0;
        margin-right: 0;
    }
    
    .opus-practitioner-info {
        flex-direction: column;
        text-align: center;
        margin-bottom: 15px;
        width: 100%;
    }
    
    .opus-practitioner-avatar,
    .opus-avatar-placeholder {
        margin-bottom: 10px;
        width: 60px;
        height: 60px;
    }
    
    .opus-practitioner-avatar {
        border-width: 2px;
    }
    
    .opus-avatar-placeholder {
        border-width: 2px;
        font-size: 24px;
    }
    
    .opus-select-btn {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }
    
    .opus-practitioner-details h5 {
        margin-bottom: 6px;
        font-size: 16px;
    }
    
    .opus-practitioner-details {
        width: 100%;
    }
    
    .opus-practitioner-title {
        font-size: 13px;
    }
    
    .opus-practitioner-languages {
        font-size: 12px;
    }
}

/* Calendar */
.opus-calendar-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
}

.opus-calendar-header {
    text-align: center;
    margin-bottom: 20px;
}

.opus-calendar-header h4 {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
}

.opus-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.opus-day-header {
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    color: #4a5568;
    padding: 10px 0;
}

.opus-calendar-date {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.opus-calendar-date:hover:not(.disabled):not(.empty) {
    background: #ebf8ff;
    border-color: #4299e1;
}

.opus-calendar-date.weekend {
    background: #f7fafc;
}

.opus-calendar-date.disabled {
    color: #cbd5e0;
    cursor: not-allowed;
    background: #f7fafc;
}

.opus-calendar-date.selected {
    background: #4299e1;
    color: white;
    border-color: #4299e1;
}

.opus-calendar-date.empty {
    border: none;
    background: transparent;
    cursor: default;
}

/* Time Slots */
#time-slots h5 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #2d3748;
}

.opus-time-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.opus-time-slot {
    padding: 12px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.opus-time-slot:hover:not(.disabled) {
    background: #ebf8ff;
    border-color: #4299e1;
}

.opus-time-slot.disabled {
    background: #f7fafc;
    color: #cbd5e0;
    cursor: not-allowed;
}

.opus-time-slot.selected {
    background: #4299e1;
    color: white;
    border-color: #4299e1;
}

/* Form */
.opus-form {
    max-width: 600px;
}

.opus-form-group {
    margin-bottom: 20px;
}

.opus-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: #4a5568;
}

.opus-form-group input[type="text"],
.opus-form-group input[type="email"],
.opus-form-group input[type="tel"],
.opus-form-group input[type="date"],
.opus-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.opus-form-group input:focus,
.opus-form-group textarea:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.opus-form-group textarea {
    resize: vertical;
}

.opus-form-group input[type="checkbox"] {
    margin-right: 8px;
}

.opus-submit-btn {
    background: #4299e1;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.opus-submit-btn:hover {
    background: #3182ce;
}

.opus-submit-btn:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
}

/* Confirmation */
.opus-success-icon {
    width: 80px;
    height: 80px;
    background: #48bb78;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    margin: 0 auto 30px;
}

.opus-confirmation-box {
    background: #f0fff4;
    border: 1px solid #9ae6b4;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.opus-confirmation-box p {
    margin: 8px 0;
    color: #2d3748;
}

.opus-new-booking-btn {
    background: #4299e1;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 20px;
}

.opus-new-booking-btn:hover {
    background: #3182ce;
}

/* Summary Sidebar */
.opus-summary {
    position: sticky;
    top: 20px;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-top: 20px;
}

.opus-summary h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #1a202c;
}

.opus-summary-item {
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.opus-summary-item strong {
    color: #4a5568;
    font-weight: 500;
}

.opus-summary-price {
    font-weight: 600;
    color: #2d3748;
}

.opus-summary-empty {
    color: #a0aec0;
    font-size: 14px;
    text-align: center;
    padding: 20px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .opus-treatment-grid {
        grid-template-columns: 1fr;
    }
    
    .opus-calendar-container {
        grid-template-columns: 1fr;
    }
    
    .opus-practitioner-info {
        flex-direction: column;
        text-align: center;
    }
    
    .opus-practitioner-card {
        flex-direction: column;
        gap: 15px;
    }
    
    .opus-select-btn {
        width: 100%;
    }
}

/* Dark theme support */
.opus-booking-container[data-theme="dark"] {
    background: #1a202c;
    color: #e2e8f0;
}

.opus-booking-container[data-theme="dark"] .opus-step {
    background: #2d3748;
    color: #e2e8f0;
}

.opus-booking-container[data-theme="dark"] .opus-treatment-card,
.opus-booking-container[data-theme="dark"] .opus-practitioner-card {
    background: #374151;
    border-color: #4a5568;
    color: #e2e8f0;
}

.opus-booking-container[data-theme="dark"] .opus-treatment-card:hover,
.opus-booking-container[data-theme="dark"] .opus-practitioner-card:hover {
    background: #4a5568;
    border-color: #4299e1;
}