/**
 * Developer Appointment Booking - Frontend Styles
 * طراحی دقیق مطابق نمونه
 */

/* Reset & Base */
.dab-booking-wrapper {
    direction: rtl;
    font-family: inherit;
    line-height: 1.6;
}

.dab-booking-wrapper * {
    box-sizing: border-box;
    font-family: inherit;
}

/* Container */
.dab-booking-container {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    max-width: 500px;
    margin: 0 auto;
}

/* Header - Dark Section */
.dab-header {
    background: #57c57b;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dab-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

/* Month Selector Button */
.dab-month-selector {
    position: relative;
}

.dab-month-dropdown {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #404040;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
}

.dab-month-dropdown:hover {
    background: #505050;
}

.dab-month-dropdown svg {
    width: 12px;
    height: 12px;
    opacity: 0.8;
}

/* Month Dropdown List */
.dab-month-list {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    min-width: 160px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
}

.dab-month-item {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    transition: background 0.15s;
}

.dab-month-item:hover {
    background: #f5f5f5;
}

.dab-month-item:first-child {
    border-radius: 12px 12px 0 0;
}

.dab-month-item:last-child {
    border-radius: 0 0 12px 12px;
}

.dab-month-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 4px 0;
}

.dab-month-current {
    background: #f0fdf4;
    color: #16a34a;
    font-weight: 600;
}

.dab-month-current:hover {
    background: #dcfce7;
}

/* Calendar Section */
.dab-calendar {
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
}

/* Weekdays Header */
.dab-weekdays {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 0 40px;
}

.dab-weekdays span {
    font-size: 12px;
    color: #666;
    font-weight: 500;
    text-align: center;
    width: 40px;
}

.dab-weekdays span.dab-friday {
    color: #ef4444;
}

/* Days Container */
.dab-days-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dab-nav-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #666;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.dab-nav-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.dab-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.dab-nav-btn svg {
    width: 14px;
    height: 14px;
}

.dab-days-container {
    display: flex;
    justify-content: space-between;
    flex: 1;
    padding: 0 8px;
}

/* Day Items */
.dab-day {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    color: #333;
    background: transparent;
}

.dab-day:hover:not(.dab-day-disabled):not(.dab-day-selected) {
    background: #f0f0f0;
}

.dab-day-disabled {
    color: #ccc;
    cursor: not-allowed;
}

.dab-day-today {
    border: 2px solid #22c55e;
}

.dab-day-selected {
    background: #22c55e !important;
    color: #fff !important;
}

.dab-day-friday {
    color: #ef4444;
}

.dab-day-friday.dab-day-disabled {
    color: #fca5a5;
}

.dab-day-empty {
    width: 40px;
    height: 40px;
}

/* Loading */
.dab-loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 14px;
    width: 100%;
}

/* Time Slots Section */
.dab-timeslots {
    padding: 20px 24px;
}

.dab-select-day-msg,
.dab-no-slots {
    text-align: center;
    padding: 30px 20px;
    color: #999;
    font-size: 14px;
    background: #fafafa;
    border-radius: 12px;
}

.dab-timeslots-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Time Slot Item - Exact Design Match */
.dab-timeslot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
}

.dab-timeslot:hover {
    border-color: #22c55e;
    background: #f0fdf4;
}

.dab-timeslot-selected {
    border-color: #22c55e;
    background: #f0fdf4;
}

.dab-timeslot-time {
    font-size: 15px;
    color: #333;
    font-weight: 500;
}

.dab-timeslot-radio {
    width: 22px;
    height: 22px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    transition: all 0.2s;
    position: relative;
}

.dab-timeslot-selected .dab-timeslot-radio {
    border-color: #22c55e;
}

.dab-timeslot-selected .dab-timeslot-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: #22c55e;
    border-radius: 50%;
}

/* Submit Section */
.dab-submit-section {
    padding: 0 24px 24px;
}

.dab-submit-btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.dab-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.dab-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Modal Overlay */
.dab-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

/* Modal */
.dab-modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
}

.dab-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
}

.dab-modal-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.dab-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.dab-modal-close:hover {
    background: #e5e5e5;
    color: #333;
}

.dab-modal-body {
    padding: 24px;
}

/* Booking Info */
.dab-booking-info {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.dab-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.dab-info-row:not(:last-child) {
    border-bottom: 1px solid #e5e7eb;
}

.dab-info-label {
    color: #666;
    font-size: 14px;
}

.dab-info-value {
    color: #1a1a1a;
    font-weight: 500;
    font-size: 14px;
}

/* Form */
.dab-form-group {
    margin-bottom: 16px;
}

.dab-form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.dab-form-group label .required {
    color: #ef4444;
}

.dab-form-group input,
.dab-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.dab-form-group input:focus,
.dab-form-group textarea:focus {
    outline: none;
    border-color: #22c55e;
}

.dab-form-group input::placeholder,
.dab-form-group textarea::placeholder {
    color: #9ca3af;
}

.dab-form-submit {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

.dab-form-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.dab-form-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Success Modal */
.dab-success-modal {
    text-align: center;
    padding: 40px 24px;
}

.dab-success-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 20px;
}

.dab-success-modal h4 {
    margin: 0 0 20px;
    font-size: 18px;
    color: #1a1a1a;
}

.dab-success-details {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
}

.dab-success-details p {
    margin: 8px 0;
    font-size: 14px;
    color: #666;
}

.dab-success-details strong {
    color: #1a1a1a;
}

.dab-success-btn {
    padding: 12px 32px;
    background: #22c55e;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.dab-success-btn:hover {
    background: #16a34a;
}

/* Error */
.dab-error {
    text-align: center;
    padding: 20px;
    color: #ef4444;
    font-size: 14px;
}

/* ==================== Tracking Form ==================== */
.dab-tracking-wrapper {
    direction: rtl;
    font-family: inherit;
    line-height: 1.6;
}

.dab-tracking-wrapper * {
    box-sizing: border-box;
    font-family: inherit;
}

.dab-tracking-container {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    max-width: 400px;
    margin: 30px auto;
}

/* Header - Dark Section */
.dab-tracking-header {
    background: #57c57b;
    padding: 24px;
    text-align: center;
}

.dab-tracking-title {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 8px;
}

.dab-tracking-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

/* Body */
.dab-tracking-body {
    padding: 24px;
}

/* Form */
.dab-tracking-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dab-tracking-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dab-tracking-input-group label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.dab-tracking-input-group input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    text-align: center;
    letter-spacing: 1px;
    transition: border-color 0.2s;
}

.dab-tracking-input-group input:focus {
    outline: none;
    border-color: #22c55e;
}

.dab-tracking-input-group input::placeholder {
    color: #9ca3af;
    letter-spacing: normal;
}

.dab-tracking-btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.dab-tracking-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.dab-tracking-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Result */
.dab-tracking-result {
    margin-top: 24px;
    background: #f8fafc;
    border-radius: 12px;
    overflow: hidden;
}

.dab-result-header {
    padding: 16px;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
}

.dab-result-body {
    padding: 8px 16px;
}

.dab-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.dab-result-row:last-child {
    border-bottom: none;
}

.dab-result-label {
    color: #6b7280;
    font-size: 14px;
}

.dab-result-value {
    color: #1a1a1a;
    font-weight: 600;
    font-size: 14px;
}

.dab-result-status {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.dab-status-pending {
    background: #fef3c7;
    color: #92400e;
}

.dab-status-confirmed {
    background: #d1fae5;
    color: #065f46;
}

.dab-status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.dab-status-completed {
    background: #dbeafe;
    color: #1e40af;
}

/* Error */
.dab-tracking-error {
    margin-top: 24px;
    background: #fee2e2;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
}

.dab-error-icon {
    width: 48px;
    height: 48px;
    background: #ef4444;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 12px;
}

.dab-tracking-error p {
    margin: 0;
    color: #991b1b;
    font-size: 14px;
    font-weight: 500;
}

button#dab-next-week {
    transform: rotate(180deg);
}
button#dab-prev-week {
    transform: rotate(180deg);
}
/* Responsive */
@media (max-width: 480px) {
    .dab-booking-container {
        border-radius: 0;
    }
    
    .dab-header {
        padding: 16px 20px;
    }
    
    .dab-calendar {
        padding: 16px 12px;
    }
    
    .dab-weekdays {
        padding: 0 32px;
    }
    
    .dab-weekdays span {
        font-size: 11px;
        width: 32px;
    }
    
    .dab-day {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }
    
    .dab-timeslots {
        padding: 16px 20px;
    }
}
