.ui-datepicker {
  background: #fff;
  border: 1px solid #dcdcdc;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 8px;
  font-family: inherit;
  z-index: 999999 !important;
}

.ui-datepicker .ui-datepicker-header {
  background: #f3f7f5;
  border: 1px solid #dfe8e3;
  border-radius: 8px;
  padding: 6px;
  margin-bottom: 6px;
}

.ui-datepicker .ui-datepicker-title {
  text-align: center;
  font-weight: 700;
  color: #1f3a2f;
}

.ui-datepicker th {
  color: #4b5e53;
  font-weight: 700;
  padding: 4px;
}

.ui-datepicker td a,
.ui-datepicker td span {
  display: block;
  text-align: center;
  padding: 6px;
  border-radius: 8px;
  color: #20342a;
  text-decoration: none;
}

.ui-datepicker td a:hover {
  background: #e8f2ec;
}

.ui-datepicker .ui-state-active {
  background: #2e8b57 !important;
  color: #fff !important;
}
/* زر الميكروفون الصوتي */
.wpwb-mic-btn {
background: #fff;
border: 1px solid #e0e0e0;
border-radius: 50%;
width: 44px;
height: 44px;
min-width: 44px;
min-height: 44px;
display: inline-flex;
align-items: center;
justify-content: center;
margin-right: 4px;
margin-left: 2px;
color: #1976d2;
transition: background 0.2s, color 0.2s;
box-shadow: 0 1px 4px rgba(25, 118, 210, 0.07);
font-size: 1.3em;
}
.wpwb-mic-btn:active, .wpwb-mic-btn:focus {
background: #e3f2fd;
color: #0d47a1;
outline: none;
}
.wpwb-mic-btn[disabled] {
opacity: 0.5;
cursor: not-allowed;
}
@media (max-width: 600px) {
  .wpwb-mic-btn {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    font-size: 1.1em !important;
  }
}
/* Main Container Styles */
.wpwb-chat-container,
.wpwb-booking-container {
max-width: 600px; /* كان 500px */
margin: 20px auto;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
border-radius: 16px;
overflow: hidden;
box-shadow: 0 4px 20px rgba(0,0,0,0.08);
background: #fff;
}

/* Header Styles */
.wpwb-chat-header,
.wpwb-booking-header {
background: linear-gradient(135deg, #2e8b57 0%, #1e5c3a 100%);
color: white;
padding: 16px 20px;
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: 10px;
}

.wpwb-booking-header {
background: linear-gradient(135deg, #1976d2 0%, #0d47a1 100%);
}

.wpwb-chat-header span,
.wpwb-booking-header span {
font-size: 1.2em;
font-weight: 600;
}

/* Button Styles */
.wpwb-btn {
border: none;
border-radius: 8px;
padding: 8px 16px;
font-size: 0.95em;
cursor: pointer;
transition: all 0.2s ease;
font-weight: 500;
}

.wpwb-btn-primary {
background: #1976d2;
color: white;
}

.wpwb-btn-primary:hover {
background: #0d47a1;
transform: translateY(-1px);
box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.wpwb-btn-report {
background: #388e3c;
color: white;
}

.wpwb-btn-report:hover {
background: #2e7d32;
}

.wpwb-btn-booking {
background: #1976d2;
color: white;
}

.wpwb-btn-send {
background: #2e8b57;
color: white;
min-width: 80px;
}

.wpwb-btn-send:hover {
background: #246b45;
}

.wpwb-btn-small {
padding: 4px 8px;
font-size: 0.85em;
border-radius: 4px;
}

.wpwb-btn-block {
width: 100%;
padding: 12px;
}

.wpwb-btn:disabled {
opacity: 0.6;
cursor: not-allowed;
transform: none;
}

/* Form Styles */
.wpwb-booking-form {
padding: 20px;
background: #f8f9fa;
display: flex;
flex-direction: column;
gap: 12px;
}

.wpwb-input,
.wpwb-textarea {
border: 2px solid #e0e0e0;
border-radius: 8px;
padding: 10px 12px;
font-size: 1em;
outline: none;
transition: all 0.2s ease;
width: 100%;
box-sizing: border-box;
}

.wpwb-input:focus,
.wpwb-textarea:focus {
border-color: #1976d2;
box-shadow: 0 0 0 3px rgba(25,118,210,0.1);
}

.wpwb-textarea {
resize: vertical;
min-height: 60px;
}

/* Messages Container */
.wpwb-chat-messages {
height: 350px;
overflow-y: auto;
padding: 20px;
background: #f5f5f5;
display: flex;
flex-direction: column-reverse;
}

/* Message Styles */
.wpwb-chat-message {
display: flex;
gap: 12px;
margin-bottom: 16px;
animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}

.wpwb-message-avatar {
width: 36px;
height: 36px;
border-radius: 50%;
background: linear-gradient(135deg, #2e8b57, #1e5c3a);
color: white;
display: flex;
align-items: center;
justify-content: center;
font-weight: bold;
font-size: 1.1em;
flex-shrink: 0;
}

.wpwb-message-content {
flex: 1;
background: white;
border-radius: 12px;
padding: 12px;
box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.wpwb-message-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 6px;
}

.wpwb-message-user {
font-weight: 600;
color: #2e8b57;
}

.wpwb-message-time {
font-size: 0.8em;
color: #999;
}

.wpwb-message-text {
line-height: 1.5;
color: #333;
word-break: break-word;
}

/* Booking Items */
.wpwb-booking-list {
padding: 20px;
background: #fff;
}

.wpwb-booking-item {
background: #e3f2fd;
border-radius: 12px;
padding: 12px;
margin-bottom: 12px;
transition: transform 0.2s ease;
}

.wpwb-booking-item:hover {
transform: translateX(-5px);
box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.wpwb-booking-item-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 8px;
}

.wpwb-booking-user {
font-weight: 600;
color: #1976d2;
}

.wpwb-booking-date-badge {
background: #1976d2;
color: white;
padding: 4px 8px;
border-radius: 20px;
font-size: 0.8em;
}

.wpwb-booking-details {
display: flex;
gap: 12px;
flex-wrap: wrap;
color: #555;
}

/* Chat Input */
.wpwb-chat-input-container {
display: flex;
gap: 10px;
padding: 15px;
background: #fff;
border-top: 1px solid #eee;
}

.wpwb-chat-input {
flex: 1;
border: 2px solid #e0e0e0;
border-radius: 24px;
padding: 10px 16px;
resize: none;
min-height: 40px;
max-height: 120px;
outline: none;
transition: all 0.2s ease;
font-family: inherit;
}

.wpwb-chat-input:focus {
border-color: #2e8b57;
box-shadow: 0 0 0 3px rgba(46,139,86,0.1);
}

/* Modal Styles */
.wpwb-modal {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0,0,0,0.5);
z-index: 10000;
align-items: center;
justify-content: center;
backdrop-filter: blur(5px);
}

.wpwb-modal-content {
background: white;
padding: 30px 25px;
border-radius: 20px;
max-width: 400px;
width: 90%;
position: relative;
animation: slideIn 0.3s ease;
}

.wpwb-report-content {
max-width: 800px;
width: 95%;
}

@keyframes slideIn {
from { transform: translateY(-30px); opacity: 0; }
to { transform: translateY(0); opacity: 1; }
}

.wpwb-modal-close {
position: absolute;
top: 15px;
right: 15px;
background: none;
border: none;
font-size: 28px;
color: #999;
cursor: pointer;
width: 36px;
height: 36px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
transition: all 0.2s ease;
}

.wpwb-modal-close:hover {
background: #f5f5f5;
color: #333;
}

.wpwb-modal-title {
margin: 0 0 20px 0;
color: #333;
font-size: 1.3em;
text-align: center;
}

/* Report Table */
.wpwb-report-table-container {
max-height: 500px;
overflow-y: auto;
margin-top: 15px;
border: 1px solid #e0e0e0;
border-radius: 8px;
}

.wpwb-report-table {
width: 100%;
border-collapse: collapse;
font-size: 0.9em;
}

.wpwb-report-table th {
background: #e8f5e9;
color: #2e8b57;
font-weight: 600;
padding: 12px 8px;
border: 1px solid #c8e6c9;
position: sticky;
top: 0;
z-index: 10;
}

.wpwb-report-table td {
padding: 10px 8px;
border: 1px solid #e0e0e0;
}

.wpwb-row-present {
background: #e8f5e9;
}

.wpwb-status-present {
color: #2e8b57;
font-weight: 600;
display: inline-flex;
align-items: center;
gap: 5px;
}

.wpwb-actions {
display: flex;
gap: 5px;
justify-content: center;
}

/* Stats and Reports */
.wpwb-stats-section {
margin: 25px 0 15px;
padding: 20px;
background: #fff;
border-radius: 12px;
box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.wpwb-stats-section h4 {
margin: 0 0 20px 0;
color: #333;
font-size: 1.2em;
border-bottom: 2px solid #e0e0e0;
padding-bottom: 10px;
}

.wpwb-stats-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 15px;
margin-bottom: 15px;
}

.wpwb-stat-card {
background: #f8f9fa;
padding: 15px;
border-radius: 10px;
text-align: center;
border: 1px solid #e0e0e0;
}

.wpwb-stat-card.wpwb-stat-present {
background: #e8f5e9;
border-color: #a5d6a7;
}

.wpwb-stat-card.wpwb-stat-rate {
background: #e3f2fd;
border-color: #90caf9;
}

.wpwb-stat-label {
display: block;
font-size: 0.9em;
color: #666;
margin-bottom: 8px;
}

.wpwb-stat-value {
display: block;
font-size: 1.8em;
font-weight: bold;
color: #1976d2;
}

.wpwb-stat-present .wpwb-stat-value {
color: #2e8b57;
}

/* Stats Table */
.wpwb-stats-table {
width: 100%;
border-collapse: collapse;
font-size: 0.95em;
background: #fff;
border-radius: 8px;
overflow: hidden;
}

.wpwb-stats-table th {
background: #2e8b57;
color: white;
padding: 12px 8px;
font-weight: 500;
}

.wpwb-stats-table td {
padding: 12px 8px;
border-bottom: 1px solid #e0e0e0;
}

.wpwb-stats-table tr:last-child td {
border-bottom: none;
}

.wpwb-stats-table tr:hover {
background: #f5f5f5;
}

.wpwb-stat-present-number {
color: #2e8b57;
font-weight: 600;
}

.wpwb-stat-percentage {
font-size: 0.85em;
color: #666;
font-weight: normal;
}

/* Progress Bar */
.wpwb-progress-cell {
min-width: 120px;
}

.wpwb-progress-bar {
background: #e0e0e0;
height: 28px;
border-radius: 14px;
position: relative;
overflow: hidden;
}

.wpwb-progress-fill {
background: linear-gradient(90deg, #2e8b57, #1e5c3a);
height: 100%;
border-radius: 14px;
transition: width 0.3s ease;
}

.wpwb-progress-text {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: white;
font-size: 0.9em;
font-weight: 600;
text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Quick Summary */
.wpwb-quick-summary {
display: flex;
justify-content: space-around;
align-items: center;
margin-top: 20px;
padding: 15px;
background: linear-gradient(135deg, #1976d2 0%, #0d47a1 100%);
border-radius: 12px;
color: white;
}

.wpwb-summary-item {
display: flex;
align-items: center;
gap: 10px;
padding: 8px 15px;
background: rgba(255,255,255,0.1);
border-radius: 25px;
}

.wpwb-summary-item.wpwb-summary-present {
background: rgba(46, 139, 86, 0.3);
}

.wpwb-summary-icon {
font-size: 1.3em;
}

.wpwb-summary-text strong {
font-size: 1.3em;
margin-left: 5px;
}

/* Status and Messages */
.wpwb-loading {
text-align: center;
padding: 40px;
color: #999;
position: relative;
}

.wpwb-loading::after {
content: '';
display: inline-block;
width: 24px;
height: 24px;
border: 3px solid #f3f3f3;
border-top-color: #2e8b57;
border-radius: 50%;
animation: spin 1s linear infinite;
margin-left: 10px;
vertical-align: middle;
}

@keyframes spin {
to { transform: rotate(360deg); }
}

.wpwb-message {
padding: 15px;
border-radius: 8px;
margin: 15px;
text-align: center;
}

.wpwb-message-error {
background: #ffebee;
color: #c62828;
border: 1px solid #ffcdd2;
}

.wpwb-success-message {
display: none;
background: #e8f5e9;
color: #2e8b57;
padding: 15px;
border-radius: 8px;
text-align: center;
margin-top: 15px;
border: 1px solid #a5d6a7;
font-weight: 600;
}

.wpwb-no-bookings,
.wpwb-no-messages,
.wpwb-no-data {
text-align: center;
color: #999;
padding: 40px;
font-size: 1.1em;
}

/* Date Range */
.wpwb-date-range {
display: flex;
gap: 15px;
align-items: flex-end;
margin-bottom: 25px;
flex-wrap: wrap;
}

.wpwb-date-field {
flex: 1;
min-width: 150px;
}

.wpwb-date-field label {
display: block;
margin-bottom: 5px;
color: #666;
font-size: 0.9em;
font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
.wpwb-chat-header,
.wpwb-booking-header {
flex-direction: column;
text-align: center;
}

.wpwb-header-buttons {
display: flex;
gap: 8px;
width: 100%;
}

.wpwb-header-buttons .wpwb-btn {
flex: 1;
}

.wpwb-date-range {
flex-direction: column;
}

.wpwb-date-field {
width: 100%;
}

.wpwb-report-table {
font-size: 0.8em;
}

.wpwb-actions {
flex-direction: column;
}

.wpwb-modal-content {
padding: 20px 15px;
}

.wpwb-stats-grid {
grid-template-columns: 1fr;
}

.wpwb-stats-table {
font-size: 0.85em;
}

.wpwb-stats-table th,
.wpwb-stats-table td {
padding: 8px 4px;
}

.wpwb-quick-summary {
flex-direction: column;
gap: 10px;
}

.wpwb-summary-item {
width: 100%;
justify-content: center;
}
}

/* RTL Support for Arabic */
[dir="rtl"] .wpwb-chat-message {
flex-direction: row-reverse;
}

[dir="rtl"] .wpwb-modal-close {
right: auto;
left: 15px;
}

[dir="rtl"] .wpwb-message-header {
flex-direction: row-reverse;
}

[dir="rtl"] .wpwb-booking-item:hover {
transform: translateX(5px);
}

[dir="rtl"] .wpwb-progress-text {
right: 50%;
left: auto;
transform: translate(50%, -50%);
}

/* تنسيق عمود الملاحظات في التقرير */
.wpwb-note-cell {
max-width: 200px;
white-space: normal;
word-wrap: break-word;
color: #666;
font-size: 0.9em;
line-height: 1.4;
background-color: #f9f9f9;
}

.wpwb-note-cell:empty::before {
content: "-";
color: #999;
font-style: italic;
}

/* تحسين عرض الجدول */
.wpwb-report-table {
table-layout: fixed;
width: 100%;
}

.wpwb-report-table th,
.wpwb-report-table td {
padding: 10px 5px;
text-align: center;
vertical-align: middle;
}

.wpwb-report-table th:nth-child(6) { /* عمود الملاحظات */
width: 150px;
}

/* استجابة شاشة الحجز على الموبايل */
@media (max-width: 600px) {
  .wpwb-chat-container,
  .wpwb-booking-container {
    max-width: 98vw !important;
    width: 98vw !important;
    min-width: 0 !important;
    margin: 8px auto !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 0 !important;
  }
  .wpwb-booking-form {
    padding: 10px !important;
    gap: 8px !important;
  }
  .wpwb-mic-btn {
    width: 32px !important;
    height: 32px !important;
    font-size: 15px !important;
    min-width: 32px !important;
    min-height: 32px !important;
  }
  .wpwb-mic-container {
    gap: 5px !important;
    margin-bottom: 8px !important;
  }
  .wpwb-mic-input {
    flex: 0 1 78%;
    min-width: 0;
    width: 78%;
    max-width: 78%;
    transition: all 0.2s ease;
  }
  .wpwb-mic-input:focus {
    border-color: #2e8b57;
    box-shadow: 0 0 0 3px rgba(46,139,86,0.1);
  }
  .wpwb-mic-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  .wpwb-btn {
    font-size: 15px !important;
    padding: 8px 10px !important;
  }
}