/* ZipScheduler Frontend Styles - Version 1.3.0 */

:root {
    --zipscheduler-green: #2F7800;
    --zipscheduler-black: #232323;
    --zipscheduler-bg: #ECECEC;
    --zipscheduler-white: #FFFFFF;
    --zipscheduler-danger: #dc3545;
    --zipscheduler-secondary: #6c757d;
}

/* Form Container */
.zipscheduler-form-container {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    background: var(--zipscheduler-white);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.zipscheduler-form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.zipscheduler-form-col {
    flex: 1;
}

.zipscheduler-form-col input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.zipscheduler-form-note {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-top: 10px;
}

/* Buttons */
.zipscheduler-btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
}

.zipscheduler-btn-primary {
    background: var(--zipscheduler-green);
    color: var(--zipscheduler-white);
    width: 100%;
}

.zipscheduler-btn-primary:hover {
    background: #256600;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.zipscheduler-btn-secondary {
    background: var(--zipscheduler-secondary);
    color: var(--zipscheduler-white);
}

.zipscheduler-btn-secondary:hover {
    background: #5a6268;
}

.zipscheduler-btn-danger {
    background: var(--zipscheduler-danger);
    color: var(--zipscheduler-white);
}

.zipscheduler-btn-danger:hover {
    background: #c82333;
}

.zipscheduler-btn-large {
    padding: 15px 30px;
    font-size: 18px;
}

.zipscheduler-btn-disabled,
.zipscheduler-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    background-color: #ccc !important;
    color: #666 !important;
}

/* Booking Container */
.zipscheduler-booking-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
    background: var(--zipscheduler-bg);
    min-height: 600px;
}

/* Accordion */
.zipscheduler-accordion {
    background: var(--zipscheduler-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.zipscheduler-accordion-item {
    border-bottom: 1px solid var(--zipscheduler-bg);
}

.zipscheduler-accordion-header {
    display: flex;
    align-items: center;
    padding: 20px;
    cursor: pointer;
    background: var(--zipscheduler-white);
    transition: background 0.3s ease;
}

.zipscheduler-accordion-item.active .zipscheduler-accordion-header {
    background: #f8f9fa;
}

.zipscheduler-step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--zipscheduler-bg);
    color: var(--zipscheduler-black);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 15px;
}

.zipscheduler-accordion-item.active .zipscheduler-step-number,
.zipscheduler-accordion-item.completed .zipscheduler-step-number {
    background: var(--zipscheduler-green);
    color: var(--zipscheduler-white);
}

.zipscheduler-step-title {
    flex: 1;
    font-size: 18px;
    font-weight: 600;
    color: var(--zipscheduler-black);
}

.zipscheduler-accordion-item.completed .zipscheduler-step-status::after {
    content: "✓";
    color: var(--zipscheduler-green);
    font-size: 20px;
    font-weight: bold;
}

.zipscheduler-accordion-content {
    display: none;
    padding: 20px;
    background: var(--zipscheduler-white);
}

.zipscheduler-accordion-item.active .zipscheduler-accordion-content {
    display: block;
}

/* Form Sections */
.zipscheduler-form-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--zipscheduler-bg);
}

.zipscheduler-form-section h3 {
    color: var(--zipscheduler-black);
    margin-bottom: 15px;
    font-size: 17px;
    font-weight: 600;
}

.zipscheduler-required {
    color: var(--zipscheduler-danger);
}

.zipscheduler-form-group {
    margin-bottom: 15px;
}

/* Question / field labels only — not inline checkbox/radio choices */
.zipscheduler-form-group > label,
.zipscheduler-form-group > .zipscheduler-field-label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--zipscheduler-black);
}

.zipscheduler-form-group input[type="text"],
.zipscheduler-form-group input[type="email"],
.zipscheduler-form-group input[type="tel"],
.zipscheduler-form-group input[type="number"],
.zipscheduler-form-group input[type="url"],
.zipscheduler-form-group input[type="date"],
.zipscheduler-form-group input[type="time"],
.zipscheduler-form-group input[type="password"],
.zipscheduler-form-group select,
.zipscheduler-form-group textarea,
.zipscheduler-form-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 14px;
    background: #fafafa;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.zipscheduler-form-group input[readonly] {
    background: #eee;
    color: #555;
    cursor: not-allowed;
}

.zipscheduler-form-group input:-webkit-autofill,
.zipscheduler-form-group input:-webkit-autofill:hover,
.zipscheduler-form-group input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #fafafa inset !important;
    -webkit-text-fill-color: #333 !important;
}

.zipscheduler-form-group input[readonly]:-webkit-autofill,
.zipscheduler-form-group input[readonly]:-webkit-autofill:hover,
.zipscheduler-form-group input[readonly]:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #eee inset !important;
    -webkit-text-fill-color: #555 !important;
}

.zipscheduler-form-group input[type="text"]:focus,
.zipscheduler-form-group input[type="email"]:focus,
.zipscheduler-form-group input[type="tel"]:focus,
.zipscheduler-form-group input[type="number"]:focus,
.zipscheduler-form-group input[type="url"]:focus,
.zipscheduler-form-group input[type="date"]:focus,
.zipscheduler-form-group input[type="time"]:focus,
.zipscheduler-form-group select:focus,
.zipscheduler-form-group textarea:focus,
.zipscheduler-form-input:focus {
    outline: none;
    border-color: var(--zipscheduler-green);
    box-shadow: 0 0 0 2px rgba(47, 120, 0, 0.12);
    background: #fff;
}

.zipscheduler-form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.zipscheduler-form-row-3 {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.zipscheduler-form-row-2 .zipscheduler-form-group,
.zipscheduler-form-row-3 .zipscheduler-form-group {
    margin-bottom: 0;
}

.zipscheduler-form-row-2:last-child,
.zipscheduler-form-row-3:last-child {
    margin-bottom: 0;
}

.zipscheduler-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.zipscheduler-radio-group label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: normal;
    color: #444;
    margin-bottom: 0;
    cursor: pointer;
}

.zipscheduler-radio-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.zipscheduler-radio-options label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: normal;
    color: #444;
    margin-bottom: 0;
    cursor: pointer;
}

.zipscheduler-checkbox-group {
    margin: 15px 0;
}

.zipscheduler-checkbox-group label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: normal;
    color: #444;
    margin-bottom: 0;
    cursor: pointer;
}

.zipscheduler-form-group input[type="checkbox"],
.zipscheduler-form-group input[type="radio"],
.zipscheduler-radio-group input[type="radio"],
.zipscheduler-radio-options input[type="radio"],
.zipscheduler-checkbox-group input[type="checkbox"] {
    width: auto;
    min-width: 16px;
    height: auto;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    accent-color: var(--zipscheduler-green);
}

.zipscheduler-form-submit {
    text-align: center;
    margin-top: 30px;
}

/* Confirmation Page */
.zipscheduler-confirmation-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
}

.zipscheduler-confirmation-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.zipscheduler-booking-details {
    background: var(--zipscheduler-white);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#zipscheduler-booking-info .booking-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid var(--zipscheduler-bg);
}

#zipscheduler-booking-info .booking-label {
    font-weight: 600;
    width: 120px;
}

#zipscheduler-booking-info .booking-value {
    flex: 1;
}

.zipscheduler-booking-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.zipscheduler-booking-actions button {
    flex: 1;
}

/* FAQ Section */
.zipscheduler-faq-section {
    background: var(--zipscheduler-white);
    padding: 30px;
    border-radius: 8px;
}

.zipscheduler-faq-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--zipscheduler-bg);
}

.zipscheduler-faq-item h3 {
    color: var(--zipscheduler-green);
    margin-bottom: 10px;
}

/* Modal */
.zipscheduler-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    background-color: rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.zipscheduler-modal.is-visible {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

body.zipscheduler-modal-open {
    overflow: hidden;
}

.zipscheduler-modal-content {
    background-color: white;
    margin: 0;
    padding: 30px;
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    position: relative;
    flex-shrink: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.zipscheduler-modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    cursor: pointer;
}

.zipscheduler-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Messages */
.zipscheduler-message {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
}

.zipscheduler-message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.zipscheduler-message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Spinner */
.zipscheduler-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--zipscheduler-green);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* Confirm Appointment Button */
.zipscheduler-confirm-btn {
    padding: 14px 18px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.zipscheduler-confirm-btn:hover {
    opacity: 0.9;
}

/* Selected Price Display */
.zipscheduler-selected-price-display {
    padding: 15px;
    background: white;
    border-radius: 8px;
    margin-bottom: 15px;
}

/* Form Inputs - Remove color overrides from inline styles */
#zipscheduler-appointment-date:focus,
#zipscheduler-appointment-time:focus {
    border-color: var(--zipscheduler-primary, #2F7800) !important;
    outline: none;
}

/* Responsive */
@media (max-width: 768px) {
    .zipscheduler-form-row {
        flex-direction: column;
    }

    .zipscheduler-form-row-2,
    .zipscheduler-form-row-3,
    .zipscheduler-confirmation-content {
        grid-template-columns: 1fr;
    }
    
    .zipscheduler-booking-actions {
        flex-direction: column;
    }
}

