/* ================================================
   Chat Sidebar Component Styles
   Supports both Order and Appointment sidebar types
   ================================================ */

/* Sidebar Overlay */
.chat-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.chat-sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Sidebar Panel */
.chat-sidebar-panel {
    position: fixed;
    top: 0;
    right: -480px;
    width: 480px;
    height: 100vh;
    background: var(--card-bg);
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
}

.chat-sidebar-panel.active {
    transform: translateX(0);
    right: 0;
}

/* Sidebar Header */
.chat-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--background);
}

.chat-sidebar-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
    letter-spacing: -0.5px;
}

.chat-sidebar-title i {
    color: var(--primary-color);
    font-size: 24px;
    background: rgba(var(--primary-color-rgb), 0.1);
    padding: 8px;
    border-radius: 10px;
}

.close-chat-sidebar-btn {
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--secondary-text);
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-chat-sidebar-btn:hover {
    background: var(--card-hover-bg);
    color: var(--text-color);
    transform: rotate(90deg);
}

/* Sidebar Content */
.chat-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* ================================================
   ORDER SIDEBAR SPECIFIC STYLES
   ================================================ */

/* Order Item Styles */
.order-item {
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.2s ease;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.order-item:last-child {
    margin-bottom: 0;
}

.order-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 24px rgba(var(--primary-color-rgb), 0.08);
    transform: translateY(-2px);
}

.order-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.order-number {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: 0.5px;
}

.order-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.order-status.pending {
    background: rgba(255, 193, 7, 0.1);
    color: #ffb300;
    border: 1px solid rgba(255, 193, 7, 0.2);
}

.order-status.processing {
    background: rgba(33, 150, 243, 0.1);
    color: #1976d2;
    border: 1px solid rgba(33, 150, 243, 0.2);
}

.order-status.shipped {
    background: rgba(156, 39, 176, 0.1);
    color: #7b1fa2;
    border: 1px solid rgba(156, 39, 176, 0.2);
}

.order-status.delivered {
    background: rgba(76, 175, 80, 0.1);
    color: #388e3c;
    border: 1px solid rgba(76, 175, 80, 0.2);
}

.order-status.cancelled {
    background: rgba(244, 67, 54, 0.1);
    color: #d32f2f;
    border: 1px solid rgba(244, 67, 54, 0.2);
}

.order-item-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.order-detail-label {
    color: var(--secondary-text);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.order-detail-label i {
    font-size: 16px;
    opacity: 0.8;
    color: var(--primary-color);
}

.order-detail-value {
    color: var(--text-color);
    font-weight: 600;
}

.order-item-footer {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
}

.order-action-btn {
    flex: 1;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--background);
    color: var(--text-color);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.order-action-btn:hover {
    background: var(--card-hover-bg);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.order-action-btn.primary {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(var(--primary-color-rgb), 0.2);
}

.order-action-btn.primary:hover {
    opacity: 0.95;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(var(--primary-color-rgb), 0.3);
}

.order-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    margin-top: 16px;
    overflow: hidden;
}

.order-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #a78bfa);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 3px;
}

/* ================================================
   APPOINTMENT SIDEBAR SPECIFIC STYLES
   ================================================ */

/* Professional Info Card */
.professional-info-card {
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 12px;
    display: flex;
    gap: 16px;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease;
}

.professional-info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.professional-avatar {
    position: relative;
    flex-shrink: 0;
}

.professional-avatar img {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    object-fit: cover;
    border: 3px solid var(--background);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.verified-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    background: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.verified-badge i {
    color: var(--primary-color);
    font-size: 18px;
}

.professional-details {
    flex: 1;
}

.professional-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 6px 0;
    letter-spacing: -0.3px;
}

.professional-title {
    font-size: 14px;
    color: var(--secondary-text);
    margin: 0 0 10px 0;
    font-weight: 500;
}

.professional-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 193, 7, 0.1);
    padding: 4px 10px;
    border-radius: 20px;
    width: fit-content;
}

.professional-rating .stars {
    display: flex;
    gap: 3px;
}

.professional-rating .stars i {
    color: #ffc107;
    font-size: 13px;
}

.professional-rating .rating-count {
    font-size: 12px;
    color: var(--text-color);
    font-weight: 600;
}

/* Appointment Section */
.appointment-section {
    margin-bottom: 32px;
}

.section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.section-title i {
    color: var(--primary-color);
    font-size: 18px;
}

/* Date Selector */
.date-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.date-nav-btn {
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    color: var(--secondary-text);
}

.date-nav-btn:hover {
    background: var(--card-hover-bg);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: scale(1.05);
}

.date-list {
    display: flex;
    gap: 10px;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 4px 0;
}

.date-list::-webkit-scrollbar {
    display: none;
}

.date-item {
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 76px;
    flex-shrink: 0;
}

.date-item:hover {
    border-color: var(--primary-color);
    background: var(--card-hover-bg);
    transform: translateY(-2px);
}

.date-item.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(var(--primary-color-rgb), 0.3);
    transform: translateY(-2px);
}

.date-item.active .date-day,
.date-item.active .date-number {
    color: white;
}

.date-day {
    font-size: 12px;
    color: var(--secondary-text);
    font-weight: 600;
    text-transform: uppercase;
}

.date-number {
    font-size: 15px;
    color: var(--text-color);
    font-weight: 700;
}

.show-more-dates-btn {
    background: transparent;
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    padding: 12px 16px;
    width: 100%;
    cursor: pointer;
    font-size: 14px;
    color: var(--secondary-text);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.show-more-dates-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.05);
}

/* Time Grid */
.time-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.time-slot {
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.time-slot:hover:not(.disabled) {
    border-color: var(--primary-color);
    background: var(--card-hover-bg);
    transform: scale(1.02);
}

.time-slot.selected {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(var(--primary-color-rgb), 0.25);
}

.time-slot.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    text-decoration: line-through;
    background: rgba(0,0,0,0.02);
}

/* Appointment Summary */
.appointment-summary {
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}

.summary-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.summary-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.summary-row:first-child {
    padding-top: 0;
}

.summary-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--secondary-text);
    font-weight: 500;
}

.summary-label i {
    color: var(--primary-color);
    font-size: 16px;
    opacity: 0.8;
}

.summary-value {
    font-size: 14px;
    color: var(--text-color);
    font-weight: 600;
}

.confirm-appointment-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px 24px;
    width: 100%;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(var(--primary-color-rgb), 0.25);
}

.confirm-appointment-btn:hover {
    opacity: 0.95;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(var(--primary-color-rgb), 0.35);
}

/* Appointments List */
.appointments-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.appointment-card {
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.appointment-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 24px rgba(var(--primary-color-rgb), 0.08);
    transform: translateY(-2px);
}

.appointment-card.upcoming {
    border-left: 4px solid #28a745;
    background: rgba(40, 167, 69, 0.05);
}

.appointment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.appointment-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.appointment-status.confirmed {
    background: rgba(33, 150, 243, 0.1);
    color: #1976d2;
    border: 1px solid rgba(33, 150, 243, 0.2);
}

.appointment-status.completed {
    background: rgba(76, 175, 80, 0.1);
    color: #388e3c;
    border: 1px solid rgba(76, 175, 80, 0.2);
}

.appointment-status.cancelled {
    background: rgba(244, 67, 54, 0.1);
    color: #d32f2f;
    border: 1px solid rgba(244, 67, 54, 0.2);
}

.appointment-status.upcoming {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.appointment-date {
    font-size: 13px;
    color: var(--secondary-text);
    font-weight: 500;
}

.appointment-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.appointment-detail {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-color);
}

.appointment-detail i {
    color: var(--primary-color);
    font-size: 16px;
    width: 20px;
    text-align: center;
    opacity: 0.8;
}

.appointment-actions {
    display: flex;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.appointment-action-btn {
    flex: 1;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--background);
    color: var(--text-color);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.appointment-action-btn:hover {
    background: var(--card-hover-bg);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.appointment-action-btn.danger {
    color: #dc3545;
    border-color: #dc3545;
    background: transparent;
}

.appointment-action-btn.danger:hover {
    background: #dc3545;
    color: white;
}

.appointment-action-btn.primary {
    color: #0d6efd;
    border-color: #0d6efd;
    background: transparent;
}

.appointment-action-btn.primary:hover {
    background: #0d6efd;
    color: white;
}

.appointment-action-btn.primary {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(var(--primary-color-rgb), 0.2);
}

.appointment-action-btn.primary:hover {
    opacity: 0.95;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(var(--primary-color-rgb), 0.3);
}

/* ================================================
   MOBILE RESPONSIVE
   ================================================ */

@media (max-width: 768px) {
    .chat-sidebar-panel {
        width: 100%;
        right: -100%;
    }
    
    .time-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .professional-info-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .professional-rating {
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .time-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .date-item {
        min-width: 68px;
        padding: 10px 12px;
    }
    
    .chat-sidebar-header {
        padding: 16px;
    }
    
    .chat-sidebar-content {
        padding: 16px;
    }
}

/* Expert List Styles */
.selectable-expert-card {
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.selectable-expert-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(var(--primary-color-rgb), 0.12);
}

.action-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--card-hover-bg);
    color: var(--primary-color);
    transition: all 0.2s ease;
}

.selectable-expert-card:hover .action-icon {
    background: var(--primary-color);
    color: white;
}

.back-to-experts-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.back-to-experts-btn:hover {
    background: var(--card-hover-bg) !important;
    color: var(--primary-color) !important;
}
