/* ==========================================================================
   Look&Book - Frontend Styles
   RTL Hebrew Calendar & Appointment System
   ========================================================================== */

/* ==========================================================================
   1. Calendar Widget
   ========================================================================== */

.wcas-calendar {
    direction: rtl;
    text-align: right;
    max-width: 600px;
    margin: 0 auto;
    padding: 24px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
    font-family: inherit;
}

/* Title */
.wcas-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
    text-align: right;
    color: #1a1a2e;
}

.wcas-subtitle {
    color: #6b7280;
    margin-bottom: 20px;
    text-align: right;
    font-size: 14px;
}

/* Labels */
.wcas-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
    color: #374151;
}

/* Location Select */
.wcas-location-wrapper {
    margin-bottom: 20px;
}

.wcas-location-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    direction: rtl;
    background: #fff;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%236b7280'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 32px;
    transition: border-color 0.2s, box-shadow 0.2s;
    color: #1f2937;
}

.wcas-location-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Calendar Container */
.wcas-calendar-container {
    margin-bottom: 20px;
}

.wcas-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 0 4px;
}

.wcas-month-title {
    font-size: 17px;
    font-weight: 700;
    color: #1f2937;
    letter-spacing: -0.01em;
}

.wcas-nav-btn {
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 15px;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.wcas-nav-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #374151;
}

/* Days header */
.wcas-calendar-days-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 6px;
}

.wcas-day-header {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #9ca3af;
    padding: 8px 0;
    text-transform: uppercase;
}

/* Calendar grid */
.wcas-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.wcas-day {
    text-align: center;
    padding: 10px 4px;
    font-size: 14px;
    border-radius: 8px;
    cursor: default;
    transition: all 0.15s ease;
    user-select: none;
    font-weight: 500;
}

.wcas-day.empty {
    visibility: hidden;
}

.wcas-day.disabled,
.wcas-day.past {
    color: #d1d5db;
}

.wcas-day.available {
    color: #059669;
    background: #ecfdf5;
    cursor: pointer;
    font-weight: 600;
}

.wcas-day.available:hover {
    background: #d1fae5;
    transform: scale(1.05);
}

.wcas-day.selected {
    background: #3b82f6 !important;
    color: #fff !important;
    transform: scale(1.05);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.35);
}

/* Time slots */
.wcas-slots-container {
    margin-bottom: 20px;
}

.wcas-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.wcas-slot {
    padding: 10px 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease;
    color: #374151;
}

.wcas-slot:hover {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1d4ed8;
}

.wcas-slot.selected {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

.wcas-no-slots {
    color: #9ca3af;
    font-size: 14px;
    padding: 20px;
    text-align: center;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px dashed #e5e7eb;
}

/* Book button */
.wcas-booking-action {
    text-align: center;
    margin-top: 20px;
}

.wcas-book-btn {
    background: #059669;
    color: #fff;
    border: none;
    padding: 12px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.wcas-book-btn:hover {
    background: #047857;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}

.wcas-book-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
}

/* Success message */
.wcas-success-message {
    background: #ecfdf5;
    color: #065f46;
    padding: 20px;
    border-radius: 8px;
    text-align: right;
    border: 1px solid #a7f3d0;
}

.wcas-success-message h3 {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 700;
}

.wcas-success-message p {
    margin: 4px 0;
    font-size: 14px;
}

/* Loading */
.wcas-loading {
    text-align: center;
    padding: 24px;
    color: #9ca3af;
    font-size: 14px;
}

/* Thank you page */
.wcas-thankyou-booking,
.wcas-thankyou-booked {
    margin-top: 30px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
    direction: rtl;
    text-align: right;
    border: 1px solid #e5e7eb;
}

.wcas-thankyou-booked {
    background: #ecfdf5;
    color: #065f46;
    border-color: #a7f3d0;
}


/* ==========================================================================
   2. My Appointments - Table & Cards
   ========================================================================== */

.wcas-my-appointments {
    direction: rtl;
    text-align: right;
}

/* No appointments state */
.wcas-no-appointments {
    padding: 48px 24px;
    text-align: center;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px dashed #d1d5db;
}

.wcas-no-appointments-icon {
    margin-bottom: 16px;
}

.wcas-no-appointments p {
    font-size: 16px;
    font-weight: 600;
    color: #6b7280;
    margin: 0 0 4px;
}

.wcas-no-appointments-sub {
    font-size: 14px;
    color: #9ca3af;
}

/* Table wrapper - card style matching admin */
.wcas-appointments-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    border: 1px solid #e5e7eb;
}

/* Appointments table - admin-matching style with high specificity to override theme */
.wcas-my-appointments .wcas-appointments-table-wrapper table.wcas-appointments-table {
    width: 100% !important;
    border-collapse: collapse !important;
    min-width: 580px;
    margin: 0 !important;
    border: none !important;
}

.wcas-my-appointments table.wcas-appointments-table thead {
    background: #f8fafc !important;
}

.wcas-my-appointments table.wcas-appointments-table thead tr th {
    padding: 12px 14px !important;
    text-align: right !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #64748b !important;
    text-transform: uppercase !important;
    letter-spacing: 0.4px !important;
    border-bottom: 2px solid #e2e8f0 !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    white-space: nowrap !important;
    background: #f8fafc !important;
}

.wcas-my-appointments table.wcas-appointments-table thead tr th:first-child,
.wcas-my-appointments table.wcas-appointments-table tbody tr td:first-child {
    padding-right: 20px !important;
}

.wcas-my-appointments table.wcas-appointments-table thead tr th:last-child,
.wcas-my-appointments table.wcas-appointments-table tbody tr td:last-child {
    padding-left: 20px !important;
}

.wcas-my-appointments table.wcas-appointments-table tbody tr td {
    padding: 12px 14px !important;
    border-bottom: 1px solid #f1f5f9 !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    font-size: 14px !important;
    color: #334155 !important;
    vertical-align: middle !important;
    background: #fff !important;
}

.wcas-my-appointments table.wcas-appointments-table tbody tr:nth-child(even) td {
    background: #f8fafc !important;
}

.wcas-my-appointments table.wcas-appointments-table tbody tr:last-child td {
    border-bottom: none !important;
}

.wcas-my-appointments table.wcas-appointments-table tbody tr:hover td {
    background: #eff6ff !important;
}

/* Force minimum padding on all cells - overrides any theme reset */
.wcas-my-appointments .wcas-appointments-table th,
.wcas-my-appointments .wcas-appointments-table td {
    padding: max(10px, var(--cell-padding, 0px)) !important;
}

.wcas-cell-date,
.wcas-cell-time {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Status badges - admin-matching pill style with high specificity */
.wcas-my-appointments span.wcas-status {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 4px 14px !important;
    border-radius: 9999px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: 0.2px !important;
    white-space: nowrap !important;
    line-height: 1.5 !important;
    border: none !important;
}

.wcas-my-appointments span.wcas-status.wcas-status-new {
    background: #dcfce7 !important;
    color: #166534 !important;
}

.wcas-my-appointments span.wcas-status.wcas-status-cancelled {
    background: #fee2e2 !important;
    color: #991b1b !important;
}

.wcas-my-appointments span.wcas-status.wcas-status-rescheduled {
    background: #fef3c7 !important;
    color: #92400e !important;
}

.wcas-my-appointments span.wcas-status.wcas-status-completed {
    background: #dbeafe !important;
    color: #1e40af !important;
}

/* Action buttons */
.wcas-cell-actions {
    white-space: nowrap;
}

/* Action buttons - matching admin appointments table exactly */
.wcas-my-appointments .wcas-appointments-table button.wcas-btn-reschedule,
.wcas-my-appointments .wcas-appointments-table button.wcas-btn-cancel {
    display: inline-flex !important;
    align-items: center !important;
    padding: 0 8px !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
    border-radius: 3px !important;
    cursor: pointer !important;
    transition: color .1s ease-in-out, border-color .1s ease-in-out, background .1s ease-in-out !important;
    border: 1px solid #c3c4c7 !important;
    background: #fff !important;
    color: #2271b1 !important;
    margin-left: 4px !important;
    line-height: 2.15 !important;
    text-decoration: none !important;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    height: 24px !important;
    white-space: nowrap !important;
}

.wcas-my-appointments .wcas-appointments-table button.wcas-btn-reschedule:hover {
    background: #f6f7f7 !important;
    border-color: #8c8f94 !important;
    color: #0a4b78 !important;
}

.wcas-my-appointments .wcas-appointments-table button.wcas-btn-cancel {
    color: #b32d2e !important;
}

.wcas-my-appointments .wcas-appointments-table button.wcas-btn-cancel:hover {
    border-color: #b32d2e !important;
    background: #f6f7f7 !important;
    color: #b32d2e !important;
}

.wcas-my-appointments .wcas-appointments-table button.wcas-btn-reschedule svg,
.wcas-my-appointments .wcas-appointments-table button.wcas-btn-cancel svg {
    flex-shrink: 0 !important;
    width: 13px !important;
    height: 13px !important;
}

.wcas-no-actions {
    color: #d1d5db;
}


/* ==========================================================================
   3. Reschedule Modal
   ========================================================================== */

.wcas-reschedule-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: wcasFadeIn 0.2s ease;
}

.wcas-reschedule-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.wcas-reschedule-content {
    position: relative;
    background: #fff;
    border-radius: 14px;
    padding: 28px;
    max-width: 560px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    direction: rtl;
    text-align: right;
    animation: wcasSlideUp 0.25s ease;
}

.wcas-reschedule-modal .wcas-reschedule-close {
    position: absolute !important;
    top: 14px !important;
    left: 14px !important;
    background: none !important;
    border: none !important;
    font-size: 24px !important;
    color: #9ca3af !important;
    cursor: pointer !important;
    width: 32px !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.15s ease;
    line-height: 1;
}

.wcas-reschedule-modal .wcas-reschedule-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.wcas-reschedule-title {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 20px;
}

.wcas-reschedule-location {
    margin-bottom: 20px;
}

.wcas-reschedule-location-name {
    padding: 10px 14px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    color: #374151;
    font-weight: 500;
}

/* Calendar inside modal */
.wcas-reschedule-calendar-container {
    margin-bottom: 16px;
}

.wcas-reschedule-calendar-container .wcas-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.wcas-reschedule-calendar-container .wcas-month-title {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
}

.wcas-reschedule-calendar-container .wcas-nav-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
}

.wcas-reschedule-calendar-container .wcas-calendar-days-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 4px;
}

.wcas-reschedule-calendar-container .wcas-day-header {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    padding: 6px 0;
}

.wcas-reschedule-calendar-container .wcas-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.wcas-reschedule-calendar-container .wcas-day {
    padding: 8px 2px;
    font-size: 13px;
}

/* Slots inside modal */
.wcas-reschedule-slots-container {
    margin-bottom: 16px;
}

.wcas-reschedule-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 6px;
    margin-top: 8px;
}

.wcas-reschedule-slots-grid .wcas-slot {
    padding: 8px 6px;
    font-size: 13px;
}

/* Modal action buttons */
.wcas-reschedule-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
}

.wcas-reschedule-modal .wcas-btn-confirm-reschedule {
    flex: 1 !important;
    padding: 10px 20px !important;
    background: #3b82f6 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    box-shadow: none !important;
    outline: none !important;
    line-height: 1.5 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

.wcas-reschedule-modal .wcas-btn-confirm-reschedule:hover:not(:disabled) {
    background: #2563eb !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3) !important;
}

.wcas-reschedule-modal .wcas-btn-confirm-reschedule:disabled {
    background: #93c5fd !important;
    cursor: not-allowed !important;
}

.wcas-reschedule-modal .wcas-btn-cancel-reschedule {
    padding: 10px 20px !important;
    background: transparent !important;
    color: #6b7280 !important;
    border: 1px solid #d1d5db !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    box-shadow: none !important;
    outline: none !important;
    line-height: 1.5 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

.wcas-reschedule-modal .wcas-btn-cancel-reschedule:hover {
    background: #f9fafb !important;
    border-color: #9ca3af !important;
    color: #374151 !important;
}


/* ==========================================================================
   4. Toast Messages
   ========================================================================== */

.wcas-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    z-index: 100000;
    animation: wcasToastIn 0.3s ease;
}

.wcas-toast.wcas-toast-success {
    background: #059669;
}

.wcas-toast.wcas-toast-error {
    background: #dc2626;
}


/* ==========================================================================
   5. Animations
   ========================================================================== */

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

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

@keyframes wcasToastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}


/* ==========================================================================
   6. Existing Appointment Notice
   ========================================================================== */

.wcas-existing-appointment {
    text-align: center;
    padding: 40px 24px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 16px;
    border: 1px solid #bae6fd;
}

.wcas-existing-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.wcas-existing-appointment h3 {
    font-size: 20px;
    color: #0c4a6e;
    margin: 0 0 20px;
}

.wcas-existing-details {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    display: inline-block;
    text-align: right;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    margin-bottom: 16px;
}

.wcas-existing-details p {
    margin: 6px 0;
    font-size: 15px;
    color: #334155;
}

.wcas-existing-note {
    font-size: 14px;
    color: #64748b;
    margin-top: 12px;
}

.wcas-existing-note a {
    color: #2563eb;
    font-weight: 600;
    text-decoration: underline;
}

.wcas-redirect-notice {
    margin-top: 16px;
    font-size: 14px;
    color: #64748b;
}

#wcas-countdown {
    display: inline-block;
    font-weight: 700;
    color: #2563eb;
    min-width: 20px;
}


/* ==========================================================================
   7. Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .wcas-calendar {
        padding: 16px;
        border-radius: 10px;
    }

    .wcas-title {
        font-size: 20px;
    }

    .wcas-slots-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Modal responsive */
    .wcas-reschedule-content {
        width: 95%;
        padding: 20px;
        max-height: 90vh;
        border-radius: 12px;
    }

    .wcas-reschedule-actions {
        flex-direction: column;
    }

    .wcas-btn-cancel-reschedule {
        order: 2;
    }

    .wcas-btn-confirm-reschedule {
        order: 1;
    }
}

@media (max-width: 480px) {
    .wcas-calendar {
        padding: 12px;
    }

    .wcas-calendar-grid .wcas-day {
        padding: 8px 2px;
        font-size: 12px;
    }

    .wcas-slots-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .wcas-day-header {
        font-size: 10px;
    }

    .wcas-month-title {
        font-size: 15px;
    }

    /* Table on mobile: keep scrollable */
    .wcas-appointments-table th,
    .wcas-appointments-table td {
        padding: 10px 10px;
        font-size: 13px;
    }

    .wcas-btn-reschedule,
    .wcas-btn-cancel {
        padding: 5px 10px;
        font-size: 12px;
    }

    /* Modal slots */
    .wcas-reschedule-slots-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .wcas-reschedule-content {
        padding: 16px;
    }

    .wcas-reschedule-title {
        font-size: 18px;
    }
}
