/**
 * Appointment Widget Styles
 */

/* General widget styling */
.axltailor-appointment-widget {
    max-width: 800px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #333;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    padding: 30px;
}

.axltailor-appointment-widget h2 {
    font-size: 26px;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 16px;
    color: #000;
}

.axltailor-appointment-widget h3 {
    font-size: 20px;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 12px;
    color: #000;
}

.axltailor-appointment-widget p {
    line-height: 1.6;
    margin-bottom: 20px;
    color: #555;
}

.axltailor-step {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Month selector */
.axltailor-month-selector {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.current-month {
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    flex: 1;
}

.month-nav {
    background: none;
    border: none;
    color: #000;
    font-size: 16px;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    outline: none;
}

.month-nav:hover {
    background-color: #f5f5f5;
    color: #000;
}

/* Calendar styling */
.axltailor-calendar {
    margin-bottom: 30px;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background-color: #f8f8f8;
    border-bottom: 1px solid #eee;
}

.weekday {
    text-align: center;
    padding: 12px 0;
    font-weight: 600;
    font-size: 14px;
    color: #666;
}

.calendar-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background-color: #fff;
    border: 1px solid #111;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.calendar-day {
    position: relative;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #111;
    cursor: default;
    transition: all 0.2s ease;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
}

.calendar-day.selectable {
    cursor: pointer;
    background-color: #fff;
}

.calendar-day.selectable:hover {
    background-color: #f1f8ff;
    border-color: #111;
}

.calendar-day.selected {
    background-color: #e1f0ff;
    border-color: #111;
    color: #0073aa;
    font-weight: 600;
}

.calendar-day.selectable:hover .day-number {
    opacity: 0.2;
    transition: opacity 0.2s ease-in-out;
}

.calendar-day.non-month,
.calendar-day.past,
.calendar-day.non-working {
    background-color: #f9f9f9;
    color: #aaa;
    pointer-events: none;
}

.calendar-day.non-working {
    position: relative;
}

.axltailor-unavailable-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 70%;
    height: 70%;
    transform: translate(-50%, -50%);
    object-fit: contain;
    opacity: 0.7;
    pointer-events: none;
    z-index: 2;
}

.axltailor-hover-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 70%;
    height: 70%;
    transform: translate(-50%, -50%);
    object-fit: contain;
    opacity: 0.8;
    pointer-events: none;
    z-index: 3;
    transition: opacity 0.2s ease-in-out;
}

.day-number {
    font-size: 14px;
    z-index: 1;
    color: #222;
}

.has-slots::after {
    content: "";
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background-color: #0073aa;
    border-radius: 50%;
}

/* Time slots */
.axltailor-time-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.time-slot {
    padding: 14px 10px;
    text-align: center;
    border-radius: 6px;
    font-size: 15px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.time-slot.available {
    background-color: #f8f8f8;
    color: #333;
    cursor: pointer;
    border-color: #eee;
}

.time-slot.available:hover {
    background-color: #f1f8ff;
    border-color: #c9e2ff;
}

.time-slot.available:not(.selected):hover > :not(.axltailor-hover-logo) {
    opacity: 0.2;
    transition: opacity 0.2s ease-in-out;
}

.time-slot.selected {
    background-color: #e1f0ff;
    border-color: #a0d1ff;
    color: #0073aa;
    font-weight: 600;
}

.time-slot.booked, .time-slot.locked {
    background-color: #f2f2f2;
    color: #999;
    position: relative;
    overflow: hidden;
    pointer-events: none;
}

.time-slot.locked::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        rgba(0, 0, 0, 0.05),
        rgba(0, 0, 0, 0.05) 5px,
        rgba(0, 0, 0, 0.02) 5px,
        rgba(0, 0, 0, 0.02) 10px
    );
}

.time-slot .axltailor-unavailable-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 70%;
    height: 70%;
    transform: translate(-50%, -50%);
    object-fit: contain;
    opacity: 0.7;
    pointer-events: none;
    z-index: 2;
}

/* Form styling */
.appointment-form-section {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 30px;
}

.appointment-form-section:last-child {
    margin-bottom: 0;
}

.form-row {
    margin-bottom: 20px;
}

.form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.2s ease;
    background-color: #fff;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.form-actions {
    margin-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.button {
    background-color: #0073aa;
    color: white;
    border: 0;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    display: inline-block;
}

.button:hover {
    background-color: #005f8b;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.back-button {
    background-color: #f2f2f2;
    color: #333;
}

.back-button:hover {
    background-color: #e6e6e6;
    color: #000;
}

/* Measurement grid */
.measurement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.measurement-item {
    margin-bottom: 5px;
}

.measurement-tip {
    margin-top: -8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
    font-style: italic;
}

.video-link {
    background: none;
    border: none;
    color: #0073aa;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    margin-left: 5px;
    vertical-align: middle;
    transition: color 0.2s ease;
}

.video-link:hover {
    color: #005177;
}

/* Affiliate code section */
.affiliate-code-container {
    display: flex;
    gap: 10px;
}

.affiliate-code-container input {
    flex: 1;
}

.affiliate-message {
    margin-top: 10px;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
}

.affiliate-message.success {
    background-color: #e6f7eb;
    color: #0a7a2b;
}

.affiliate-message.error {
    background-color: #f8e8e7;
    color: #c02b21;
}

/* Loading indicator */
.axltailor-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #0073aa;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

/* Error message */
.axltailor-error {
    background-color: #f8e8e7;
    border-left: 4px solid #c02b21;
    padding: 16px;
    margin: 20px 0;
    color: #c02b21;
}

/* Confirmation screen */
.confirmation-message {
    text-align: center;
    padding: 40px 20px;
}

.confirmation-message h2 {
    margin-bottom: 20px;
    color: #0a7a2b;
}

/* Modal styles */
.axltailor-modal {
    position: fixed;
    z-index: 1050;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 700px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    animation: modalFadeIn 0.3s ease-out;
}

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

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    font-weight: 700;
    color: #999;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-modal:hover {
    color: #000;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    margin-top: 20px;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Responsive styles */
@media (max-width: 768px) {
    .axltailor-appointment-widget {
        padding: 20px;
        border-radius: 6px;
    }
    
    .axltailor-month-selector {
        flex-direction: row;
        align-items: center;
    }
    
    .current-month {
        font-size: 18px;
    }
    
    .measurement-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    
    .axltailor-time-slots {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .weekday {
        font-size: 12px;
        padding: 8px 0;
    }
    
    .calendar-day {
        height: 40px;
    }
    
    .affiliate-code-container {
        flex-direction: column;
    }
    
    .affiliate-code-container input {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .appointment-form-section {
        padding: 20px;
    }
    
    .modal-content {
        padding: 20px;
        width: 95%;
    }
}

/* Widget container minimal look */
.axltailor-step, .axltailor-calendar-widget, #appointment-form, .axltailor-time-slots, .calendar-body {
    border-radius: 8px;
    border: 1px solid #111;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

/* Remove excessive padding/margins for minimalism */
.axltailor-step, .axltailor-calendar-widget, #appointment-form {
    padding: 16px 12px;
    margin: 0 0 16px 0;
}

/* Buttons minimal look */
button, .button, input[type="submit"] {
    border-radius: 4px;
    border: 1px solid #111;
    background: #fff;
    color: #111;
    font-weight: 500;
    padding: 6px 16px;
    transition: background 0.2s, color 0.2s;
}
button:hover, .button:hover, input[type="submit"]:hover {
    background: #111;
    color: #fff;
}

/* Remove box shadows from time slots for minimalism */
.axltailor-time-slots .time-slot {
    box-shadow: none;
    border: 1px solid #111;
    border-radius: 4px;
    background: #fafbfc;
    color: #222;
}

.axltailor-time-slots .time-slot.selected {
    background: #e1f0ff;
    color: #0073aa;
    border-color: #0073aa;
}

/* Remove the hashed background effect from all unavailable days */
.calendar-day.past::after,
.calendar-day.non-working::after {
    display: none;
}

.calendar-day.past,
.calendar-day.non-working {
    background-color: #f9f9f9;
    color: #aaa;
    pointer-events: none;
}

/* Ensure the overlay is not hidden on past days anymore */
.calendar-day.past .axltailor-unavailable-overlay {
    display: block; /* Overrides any previous display:none */
} 

/* Logo Styles */
.axl-widget-logo {
    text-align: center;
    margin-bottom: 20px;
}

.axl-widget-logo img {
    max-width: 150px;
    height: auto;
} 