/**
 * Opus Dental Popup Booking Styles
 * Clean, white design for dental clinics
 * Theme-agnostic with comprehensive isolation
 */

/* CSS Reset and Base Styles for Theme Agnostic Design */
.opus-popup-overlay,
.opus-popup-overlay *,
.opus-popup-overlay *:before,
.opus-popup-overlay *:after {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
    box-sizing: border-box;
    background: transparent;
    color: inherit;
    text-decoration: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

/* Establish baseline typography that works with any theme */
.opus-popup-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333333;
    text-align: left;
    direction: ltr;
}

/* Ensure proper block-level elements */
.opus-popup-container div,
.opus-popup-container section,
.opus-popup-container article,
.opus-popup-container main,
.opus-popup-container header,
.opus-popup-container footer {
    display: block;
}

/* Typography reset that works across themes */
.opus-popup-container h1,
.opus-popup-container h2,
.opus-popup-container h3,
.opus-popup-container h4,
.opus-popup-container h5,
.opus-popup-container h6 {
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 15px 0;
    color: #1a1a1a;
}

.opus-popup-container p {
    margin: 0 0 15px 0;
    line-height: 1.6;
}

.opus-popup-container strong,
.opus-popup-container b {
    font-weight: 600;
}

/* Form elements that work universally */
.opus-popup-container input,
.opus-popup-container textarea,
.opus-popup-container select,
.opus-popup-container button {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    color: inherit;
}

.opus-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    animation: opusFadeIn 0.2s ease-in-out;
}

@keyframes opusFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.opus-popup-container {
    background: white;
    border-radius: 8px;
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    animation: opusSlideUp 0.3s ease-out;
}

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

.opus-popup-header {
    background: white;
    color: #333;
    padding: 25px 60px 25px 30px; /* Extra padding on right for close button */
    position: relative;
    border-bottom: 2px solid #f0f0f0;
}

.opus-popup-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: #333;
    font-family: 'Montserrat', Arial, sans-serif;
}

.opus-popup-header .clinic-name {
    color: #0C71C3;
    font-weight: 700;
}

.opus-popup-close {
    background: none;
    border: none;
    color: #999;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 1000;
}

.opus-popup-close:hover {
    background-color: #f5f5f5;
    color: #333;
}

.opus-popup-body {
    padding: 0;
    max-height: calc(85vh - 80px);
    overflow-y: auto;
    background: white;
}

/* Clean timeline design */
.opus-popup-steps {
    background: #fafafa;
    padding: 30px 20px;
    border-bottom: 1px solid #eee;
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

/* Timeline background line */
.opus-popup-steps:before {
    content: '';
    position: absolute;
    top: 45px; /* Center with circles */
    left: 60px;
    right: 60px;
    height: 2px;
    background: #ddd;
    z-index: 1;
}

/* Individual step */
.opus-step-indicator {
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center;
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    min-width: 80px;
    vertical-align: top;
}

/* Step circle */
.opus-step-indicator span {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: white;
    border: 2px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #999;
    font-size: 14px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

/* Step label */
.opus-step-indicator label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
    line-height: 1.3;
    text-align: center;
    max-width: 70px;
}

/* Active step */
.opus-step-indicator.active span {
    background: #0C71C3;
    border-color: #0C71C3;
    color: white;
}

.opus-step-indicator.active label {
    color: #0C71C3;
    font-weight: 600;
}

/* Completed step */
.opus-step-indicator.completed span {
    background: #0C71C3;
    border-color: #0C71C3;
    color: white;
}

.opus-step-indicator.completed label {
    color: #0C71C3;
    font-weight: 600;
}

/* Update background line for completed steps */
.opus-popup-steps.step-2:before,
.opus-popup-steps.step-3:before,
.opus-popup-steps.step-4:before {
    background: linear-gradient(to right, #0C71C3 0%, #0C71C3 33%, #ddd 33%);
}

.opus-popup-steps.step-3:before {
    background: linear-gradient(to right, #0C71C3 0%, #0C71C3 66%, #ddd 66%);
}

.opus-popup-steps.step-4:before {
    background: #0C71C3;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(12, 113, 195, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(12, 113, 195, 0); }
    100% { box-shadow: 0 0 0 0 rgba(12, 113, 195, 0); }
}

/* Step labels */
.opus-step-indicator label {
    font-size: 13px;
    color: #666;
    font-weight: 500;
    font-family: 'Montserrat', Arial, sans-serif;
    text-align: center;
    transition: color 0.3s;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.opus-step-indicator.completed label,
.opus-step-indicator.active label {
    color: #0C71C3;
    font-weight: 600;
}

.opus-popup-content {
    padding: 35px;
    background: white;
}

.opus-popup-overlay .opus-step-content {
    display: none !important;
}

.opus-popup-overlay .opus-step-content.active {
    display: block !important;
    animation: opusFadeIn 0.2s ease-in-out;
}

.opus-step-content h3 {
    margin: 0 0 25px 0;
    font-size: 18px;
    color: #333;
    font-weight: 600;
    font-family: 'Montserrat', Arial, sans-serif;
}

.opus-treatments-grid,
.opus-practitioners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.opus-treatment-item,
.opus-practitioner-item {
    background: white;
    border: 2px solid #e8e8e8;
    border-radius: 6px;
    padding: 18px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

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

.opus-all-practitioners {
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
    border-color: #0C71C3;
    border-width: 2px;
}

.opus-all-practitioners:hover {
    background: linear-gradient(135deg, #e6f3ff 0%, #d9edff 100%);
    box-shadow: 0 6px 16px rgba(12, 113, 195, 0.2);
}

/* Add recommended badge to first available */
.opus-all-practitioners:before {
    content: "Anbefalt";
    position: absolute;
    top: -10px;
    right: 15px;
    background: #0C71C3;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.opus-treatment-item h4,
.opus-practitioner-item h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #1a202c;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Add person icon before practitioner name */
.opus-practitioner-item h4:before {
    content: "👤";
    font-size: 18px;
    opacity: 0.7;
}

.opus-all-practitioners h4:before {
    content: "⭐";
    font-size: 18px;
    opacity: 1;
}

.opus-treatment-info,
.opus-practitioner-title {
    margin: 0;
    font-size: 13px;
    color: #666;
    padding-left: 26px;
}

.opus-practitioner-info {
    margin: 5px 0 0 0;
    font-size: 12px;
    color: #0C71C3;
    font-weight: 500;
    padding-left: 26px;
}

.opus-practitioner-lang {
    margin: 5px 0 0 0;
    font-size: 12px;
    color: #999;
    padding-left: 26px;
}

/* Practitioner with image styles */
.opus-practitioner-item.has-image {
    padding: 0;
    overflow: hidden;
}

.opus-practitioner-with-image {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px;
}

.opus-practitioner-photo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e8e8e8;
    flex-shrink: 0;
}

.opus-practitioner-item.has-image:hover .opus-practitioner-photo {
    border-color: #0C71C3;
}

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

.opus-practitioner-details h4 {
    margin: 0 0 5px 0;
    padding-left: 0;
}

.opus-practitioner-details h4:before {
    display: none;
}

.opus-practitioner-details .opus-practitioner-title {
    margin: 0 0 3px 0;
    padding-left: 0;
}

.opus-practitioner-details .opus-practitioner-lang {
    margin: 0;
    padding-left: 0;
}

.opus-summary {
    background: #fafafa;
    border-radius: 6px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid #eee;
}

.opus-summary p {
    margin: 12px 0;
    font-size: 15px;
    color: #333;
    font-family: 'Montserrat', Arial, sans-serif;
}

.opus-summary-item {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
}

.opus-summary strong {
    color: #1a202c;
    min-width: 120px;
    display: inline-block;
    font-weight: 600;
}

/* Mobile: Stack labels and values */
@media (max-width: 768px) {
    .opus-summary-item {
        flex-direction: column;
        gap: 4px;
    }
    
    .opus-summary strong {
        min-width: auto;
        margin-bottom: 2px;
    }
    
    .opus-summary-item span {
        padding-left: 0;
        font-weight: 500;
    }
}

.opus-info {
    color: #666;
    font-size: 14px;
    margin-bottom: 25px;
    font-family: 'Montserrat', Arial, sans-serif;
}

.opus-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.opus-back-btn,
.opus-confirm-btn {
    padding: 12px 28px;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-family: 'Montserrat', Arial, sans-serif;
}

.opus-back-btn {
    background: white;
    color: #666;
    border: 2px solid #e0e0e0;
}

.opus-back-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.opus-confirm-btn {
    background: #0C71C3;
    color: white;
    border: 2px solid #0C71C3;
}

.opus-confirm-btn:hover {
    background: #0a5fa5;
    border-color: #0a5fa5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(12, 113, 195, 0.2);
}

/* Scrollbar styling */
.opus-popup-body::-webkit-scrollbar {
    width: 8px;
}

.opus-popup-body::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.opus-popup-body::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.opus-popup-body::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Form styling */
.opus-form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.opus-form-group {
    flex: 1;
    margin-bottom: 15px;
}

.opus-form-group-small {
    flex: 0 0 120px;
}

.opus-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.opus-form-group input,
.opus-form-group textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.opus-form-group input:focus,
.opus-form-group textarea:focus {
    outline: none;
    border-color: #0C71C3;
    box-shadow: 0 0 0 2px rgba(12, 113, 195, 0.1);
}

.opus-form-group input::placeholder,
.opus-form-group textarea::placeholder {
    color: #999;
}

/* Consent checkboxes */
.opus-consent-group {
    margin: 20px 0;
}

.opus-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
}

/* Hide the default checkbox completely */
.opus-checkbox input[type="checkbox"] {
    position: absolute;
    left: -9999px;
    opacity: 0;
    visibility: hidden;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
    outline: none !important;
}

/* Custom checkbox design */
.opus-checkbox .checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 4px;
    margin-top: 1px;
    flex-shrink: 0;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
    background: white;
    display: inline-block;
}

.opus-checkbox:hover .checkmark {
    border-color: #0C71C3;
    box-shadow: 0 0 0 2px rgba(12, 113, 195, 0.1);
}

.opus-checkbox input[type="checkbox"]:checked + .checkmark {
    background-color: #0C71C3;
    border-color: #0C71C3;
}

.opus-checkbox input[type="checkbox"]:checked + .checkmark:after {
    content: "✓";
    position: absolute;
    color: white;
    font-size: 14px;
    font-weight: bold;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: block;
}

.opus-checkbox .checkmark:after {
    content: "";
    display: none;
}

.opus-consent-group a {
    color: #0C71C3;
    text-decoration: underline;
}

.opus-consent-group a:hover {
    color: #0a5fa5;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .opus-form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .opus-form-group-small {
        flex: 1;
    }
    
    .opus-popup-container {
        width: 95%;
        max-height: 95vh;
        margin: 10px;
    }
    
    .opus-popup-header {
        padding: 20px 50px 20px 20px;
    }
    
    .opus-popup-header h2 {
        font-size: 18px;
    }
    
    .opus-popup-steps {
        padding: 18px 10px;
        max-width: none;
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        gap: 0;
    }
    
    .opus-popup-steps:before {
        top: 30px;
        left: 12%;
        right: 12%;
        height: 1.5px;
    }
    
    .opus-step-indicator {
        min-width: auto;
        flex: 1;
        max-width: none;
        padding: 0;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }
    
    .opus-step-indicator span {
        width: 28px;
        height: 28px;
        font-size: 12px;
        margin-bottom: 5px;
        border-width: 2px;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .opus-step-indicator label {
        font-size: 10px;
        max-width: 65px;
        line-height: 1.3;
        padding: 0;
        text-align: center;
        word-break: break-word;
    }
    
    
    .opus-treatments-grid,
    .opus-practitioners-grid {
        grid-template-columns: 1fr;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .opus-popup-steps {
        padding: 15px 8px;
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        gap: 0;
    }
    
    .opus-popup-steps:before {
        top: 23px;
        left: 12%;
        right: 12%;
        height: 1px;
    }
    
    .opus-step-indicator {
        min-width: auto;
        flex: 1;
        max-width: none;
        padding: 0;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }
    
    .opus-step-indicator span {
        width: 22px;
        height: 22px;
        font-size: 11px;
        margin-bottom: 4px;
        border-width: 1.5px;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .opus-step-indicator label {
        font-size: 9px;
        max-width: 50px;
        line-height: 1.2;
        font-weight: 400;
        text-align: center;
        word-break: break-word;
        hyphens: auto;
    }
    
    
    .opus-popup-content {
        padding: 25px 20px;
    }
    
    .opus-actions {
        flex-direction: column;
    }
    
    .opus-back-btn,
    .opus-confirm-btn {
        width: 100%;
    }
}

/* Very small screens - show only numbers */
@media (max-width: 380px) {
    .opus-popup-steps {
        padding: 12px 5px;
    }
    
    .opus-popup-steps:before {
        top: 18px;
        left: 15%;
        right: 15%;
    }
    
    .opus-step-indicator span {
        width: 24px;
        height: 24px;
        font-size: 12px;
        margin-bottom: 0;
    }
    
    .opus-step-indicator label {
        display: none !important;
    }
}

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

.opus-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f0f0f0;
    border-top-color: #0C71C3;
    border-radius: 50%;
    animation: opusSpin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes opusSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Animations for feedback - NO LONGER USED
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}
*/

/* Make the Neste button more prominent when shown */
#opus-next-btn-3 {
    animation: none;
}

#opus-next-btn-3:not([style*="display: none"]) {
    background: #0C71C3 !important;
    box-shadow: 0 4px 12px rgba(12, 113, 195, 0.3) !important;
}

/* No results state */
.opus-no-results {
    text-align: center;
    padding: 40px;
    color: #666;
    font-family: 'Montserrat', Arial, sans-serif;
}

.opus-no-results svg {
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
    opacity: 0.3;
}

/* Selection display for step 2 and 3 */
.opus-selection-display {
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
    border: 2px solid #0C71C3;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(12, 113, 195, 0.1);
}

.opus-selected-treatment {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
}

/* Step 3 specific - showing both treatment and practitioner */
.opus-selected-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.opus-selection-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
}

.opus-selection-row .opus-selection-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.opus-selection-row .opus-selection-label:before {
    content: "✓";
    display: inline-flex;
    width: 24px;
    height: 24px;
    background: #0C71C3;
    color: white;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.opus-selection-label {
    color: #666;
    font-weight: 500;
    font-family: 'Montserrat', Arial, sans-serif;
}

.opus-selection-value {
    color: #0C71C3;
    font-weight: 700;
    font-family: 'Montserrat', Arial, sans-serif;
    font-size: 18px;
}

/* Add icon before label */
.opus-selection-label:before {
    content: "✓";
    display: inline-block;
    width: 24px;
    height: 24px;
    background: #0C71C3;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    margin-right: 8px;
    font-weight: bold;
}

/* Mobile adjustments for selection display */
@media (max-width: 768px) {
    .opus-selection-display {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .opus-selected-treatment {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .opus-selection-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .opus-selection-value {
        font-size: 16px;
        padding-left: 32px; /* Indent to align with checkmark */
    }
}

/* Calendar display */
.opus-calendar-wrapper {
    min-height: 300px;
    position: relative;
}

/* New Calendar Styles */
.opus-calendar-container {
    display: flex;
    gap: 30px;
    margin-top: 20px;
}

.opus-date-calendar {
    flex: 1;
    max-width: 400px;
}

.opus-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f7fafc;
    border-radius: 8px;
}

.opus-month-nav {
    background: #0C71C3;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.2s;
}

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

.opus-month-year {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

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

.opus-calendar-weekdays > div {
    text-align: center;
    font-weight: 600;
    color: #666;
    font-size: 12px;
    padding: 5px;
}

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

.opus-calendar-date {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: default;
    font-weight: 500;
    transition: all 0.2s;
    background: white;
}

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

.opus-calendar-date.available {
    cursor: pointer;
    background: #f0f8ff;
    border-color: #0C71C3;
    color: #0C71C3;
}

.opus-calendar-date.available:hover {
    background: #0C71C3;
    color: white;
    transform: scale(1.05);
}

.opus-calendar-date.selected {
    background: #0C71C3;
    color: white;
    border-color: #0a5fa5;
}

.opus-calendar-date.disabled {
    color: #ccc;
    background: #f5f5f5;
    border-color: #e0e0e0;
}

.opus-calendar-date.past {
    color: #ddd;
    background: #fafafa;
}

.opus-calendar-date.today {
    border-color: #0C71C3;
    font-weight: 700;
}

/* Time slots section */
.opus-time-slots {
    flex: 1;
    padding: 20px;
    background: #fafafa;
    border-radius: 8px;
}

.opus-selected-date-header {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.opus-times-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

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

.opus-time-slot:hover {
    background: #0C71C3;
    color: white;
    border-color: #0C71C3;
    transform: translateY(-2px);
}

.no-times {
    text-align: center;
    color: #999;
    padding: 20px;
}

.opus-loading-times {
    text-align: center;
    padding: 20px;
}

/* Week navigation styling */
.opus-week-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: #f7fafc;
    border-radius: 8px;
    margin-bottom: 20px;
    gap: 15px;
}

.opus-nav-btn {
    background: #0C71C3;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.opus-nav-btn:hover {
    background: #0a5fa5;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(12, 113, 195, 0.2);
}

.opus-week-selector {
    flex: 1;
    text-align: center;
    position: relative;
}

.opus-week-display {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
}

.opus-week-display:hover {
    border-color: #0C71C3;
    box-shadow: 0 2px 8px rgba(12, 113, 195, 0.1);
    background: #f0f8ff;
}

.opus-week-display:active {
    transform: scale(0.98);
}

.opus-week-number {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    display: block;
    margin-bottom: 4px;
    position: relative;
    padding-right: 20px;
}

.opus-week-number:after {
    content: "📅";
    position: absolute;
    right: 0;
    top: 0;
    font-size: 14px;
    opacity: 0.6;
}

.opus-week-dates {
    font-size: 12px;
    color: #666;
    display: block;
}

/* Hide the actual date input */
#opus-date-picker {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.opus-calendar-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.opus-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f0f0f0;
    border-top-color: #0C71C3;
    border-radius: 50%;
    animation: opusSpin 1s linear infinite;
    margin-bottom: 15px;
}

.opus-calendar-display {
    max-height: 500px;
    overflow-y: auto;
    background: #fafafa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

/* Fallback and error messages */
.opus-calendar-fallback,
.opus-error-message,
.opus-fallback {
    text-align: center;
    padding: 30px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.opus-ready-message {
    text-align: center;
    padding: 30px;
}

.opus-selection-summary {
    background: #f7fafc;
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.opus-selection-summary p {
    margin: 8px 0;
    color: #4a5568;
}

.opus-open-btn {
    background: #0C71C3;
    color: white;
    border: none;
    padding: 14px 30px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 20px;
}

.opus-open-btn:hover {
    background: #0a5fa5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(12, 113, 195, 0.2);
}

/* Navigation row for calendar buttons */
.opus-nav-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 10px;
}

/* Ensure step 3 is visible when active */
#opus-step-3.active {
    display: block !important;
}

/* Calendar wrapper should be visible */
.opus-calendar-wrapper,
#opus-calendar-display {
    display: block !important;
    min-height: 200px;
}

/* Style the fetched calendar content */
.opus-calendar-content {
    font-family: 'Montserrat', Arial, sans-serif;
}

.opus-calendar-content table {
    width: 100%;
    border-collapse: collapse;
}

.opus-calendar-content td,
.opus-calendar-content th {
    padding: 10px;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.opus-calendar-content button,
.opus-calendar-content .time-slot {
    background: #0C71C3;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.opus-calendar-content button:hover,
.opus-calendar-content .time-slot:hover {
    background: #0a5fa5;
    transform: translateY(-1px);
}

/* Next step preview */
.opus-next-step {
    background: #f0f8ff;
    border: 2px solid #0C71C3;
    border-radius: 8px;
    padding: 25px;
    margin: 20px 0;
    text-align: center;
}

.opus-next-step-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.opus-next-step h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #0C71C3;
    font-weight: 600;
}

.opus-next-step p {
    margin: 0 0 15px 0;
    color: #4a5568;
    font-size: 14px;
}

.opus-next-step ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
    max-width: 350px;
    margin: 0 auto;
}

.opus-next-step ul li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
    color: #4a5568;
    font-size: 14px;
}

.opus-next-step ul li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #0C71C3;
    font-weight: bold;
}

/* Responsive calendar */
@media (max-width: 768px) {
    .opus-calendar-container iframe {
        height: 400px !important;
    }
    
    .opus-popup-steps {
        gap: 20px;
        padding: 15px;
        flex-wrap: wrap;
    }
    
    .opus-step-indicator {
        min-width: 60px;
    }
    
    .opus-step-indicator span {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    
    .opus-step-indicator label {
        font-size: 10px;
    }
    
    /* Calendar mobile adjustments */
    .opus-calendar-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .opus-date-calendar {
        max-width: 100%;
    }
    
    .opus-calendar-dates {
        gap: 3px;
    }
    
    .opus-calendar-date {
        font-size: 14px;
    }
    
    .opus-time-slots {
        padding: 15px;
    }
    
    .opus-times-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 8px;
    }
    
    /* Week navigation mobile */
    .opus-week-navigation {
        padding: 10px;
        gap: 10px;
    }
    
    .opus-nav-btn {
        padding: 8px 12px;
        font-size: 16px;
    }
    
    .opus-week-display {
        padding: 8px 15px;
    }
    
    .opus-week-number {
        font-size: 14px;
    }
    
    .opus-week-dates {
        font-size: 11px;
    }
}