/* Doctor Book - Frontend & Admin Styles */

/* ===== Frontend widget ===== */
.dbook-widget {
    max-width: 600px;
    margin: 0 auto;
    padding: 24px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-sizing: border-box;
}

.dbook-widget *,
.dbook-widget *::before,
.dbook-widget *::after {
    box-sizing: border-box;
}

.dbook-step-title {
    font-size: 1.25em;
    margin: 0 0 16px;
    color: #222;
}

.dbook-back {
    background: none;
    border: none;
    color: #007cba;
    font-size: 13px;
    font-weight: 600;
    padding: 0 0 14px;
    cursor: pointer;
}

.dbook-back:hover {
    text-decoration: underline;
}

/* Month select */
.dbook-month-select {
    max-width: 260px;
}

/* Days */
.dbook-days-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    min-height: 40px;
}

.dbook-day-btn {
    padding: 12px 8px;
    text-align: center;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    background: #fff;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.dbook-day-btn:hover {
    border-color: #007cba;
    background: #f0f7fc;
    color: #007cba;
}

.dbook-day-btn.selected {
    background: #007cba;
    border-color: #007cba;
    color: #fff;
}

.dbook-hint,
.dbook-loading {
    color: #888;
    font-style: italic;
    text-align: center;
    grid-column: 1 / -1;
    margin: 0;
    padding: 10px 0;
}

/* Patient form */
.dbook-summary {
    background: #f0f7fc;
    border: 1px solid #d7e9f5;
    color: #0d1b2a;
    padding: 10px 14px;
    border-radius: 6px;
    font-weight: 600;
    margin: 0 0 16px;
}

.dbook-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

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

.dbook-input,
.dbook-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.dbook-input:focus,
.dbook-textarea:focus {
    border-color: #007cba;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,124,186,0.2);
}

.dbook-btn {
    display: inline-block;
    padding: 12px 28px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}

.dbook-btn-primary {
    background: #007cba;
    color: #fff;
    width: 100%;
}

.dbook-btn-primary:hover {
    background: #005a87;
}

.dbook-btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Success step */
.dbook-step-success {
    text-align: center;
    padding: 10px 0;
}

.dbook-success-icon {
    width: 56px;
    height: 56px;
    line-height: 56px;
    border-radius: 50%;
    background: #d4edda;
    color: #155724;
    font-size: 28px;
    margin: 0 auto 14px;
}

/* Messages */
.dbook-message {
    padding: 12px 15px;
    border-radius: 4px;
    margin-top: 15px;
    font-size: 14px;
}

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

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

.dbook-error {
    color: #721c24;
    padding: 10px;
    background: #f8d7da;
    border-radius: 4px;
}

/* ===== Admin: per-doctor shortcode box ===== */
.dbook-shortcode-box {
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    padding: 14px 16px;
    margin: 16px 0;
    max-width: 520px;
}

.dbook-shortcode-box label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
}

.dbook-shortcode-box input {
    width: 100%;
    font-family: Consolas, Monaco, monospace;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
}

.dbook-shortcode-box .description {
    margin: 8px 0 0;
    color: #666;
}

/* ===== Admin ===== */
.doctor-book-delete-schedule,
.doctor-book-delete-booking {
    color: #a00;
}

.doctor-book-delete-schedule:hover,
.doctor-book-delete-booking:hover {
    color: #dc3232;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
    .dbook-widget {
        padding: 15px;
    }
    .dbook-days-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .dbook-day-btn {
        padding: 10px 4px;
        font-size: 13px;
    }
}

/* ===== RTL (Arabic, etc.) =====
   The widget sets dir="rtl"/"ltr" on its root element based on is_rtl(),
   so the widget itself is always readable regardless of whether the
   surrounding theme is RTL-aware. Flexbox/grid already flow correctly
   with dir="rtl" automatically; the rules below only fix the few spots
   that use an explicit physical direction. */
.dbook-widget[dir="rtl"] {
    text-align: right;
}

.dbook-widget[dir="rtl"] .dbook-back {
    padding: 0 14px 0 0;
}

.dbook-widget[dir="rtl"] .dbook-message-error,
.dbook-widget[dir="rtl"] .dbook-message-success,
.dbook-widget[dir="rtl"] .dbook-error {
    text-align: right;
}
