
/* Doctor Portal Responsive Styles */

.booking-list {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}

.booking-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.booking-card:hover {
    transform: translateY(-2px);
}

.patient-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 20px 0;
    overflow-x: auto;
    padding: 10px 0;
}

.patient-tabs button {
    padding: 12px 20px;
    border: none;
    background: white;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.patient-tabs button.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(10, 137, 209, 0.3);
}

.patient-tabs button:hover:not(.active) {
    background: rgba(10, 137, 209, 0.1);
}

/* Tab Content */
.tab-content {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 25px;
    margin-top: 20px;
    box-shadow: var(--shadow);
}

/* Doctor Login Form */
#doctorLogin {
    max-width: 420px;
    margin: 0 auto;
    background: var(--card-bg);
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

#doctorLogin input {
    width: 100%;
    padding: 16px;
    margin: 12px 0;
    border-radius: 30px;
    border: 2px solid var(--border);
    font-size: 16px;
    background: var(--bg);
    color: var(--text);
}

#doctorLogin input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(10, 137, 209, 0.1);
}

/* Doctor Dashboard */
#doctorDashboard {
    display: none;
    width: 100%;
}

.doctor-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary), #0a6ba8);
    color: white;
    border-radius: 16px;
}

.doctor-header h1 {
    color: white;
    margin-bottom: 10px;
}

.doctor-header p {
    opacity: 0.9;
    font-size: 16px;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .patient-tabs {
        justify-content: flex-start;
        padding: 10px 5px;
    }
    
    .patient-tabs button {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    #doctorLogin {
        padding: 30px 20px;
        margin: 0 15px;
    }
    
    .tab-content {
        padding: 20px 15px;
        margin: 0 -15px;
        border-radius: 0;
    }
    
    .booking-card {
        padding: 15px;
    }
    
    .doctor-header {
        margin: 0 -15px 30px -15px;
        border-radius: 0;
        padding: 20px 15px;
    }
}

@media (max-width: 480px) {
    .patient-tabs {
        gap: 8px;
    }
    
    .patient-tabs button {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    #doctorLogin {
        padding: 25px 15px;
    }
    
    .doctor-header h1 {
        font-size: 24px;
    }
}

/* Chat System Responsive Styles */
.chat-container {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 0;
    height: 650px;
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.chat-sidebar {
    background: var(--bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.chat-list-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    background: var(--primary);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.chat-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.chat-item {
    padding: 18px 20px;
    background: transparent;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

.chat-item:hover {
    background: rgba(10, 137, 209, 0.05);
}

.chat-item.active {
    background: rgba(10, 137, 209, 0.1);
    border-left: 4px solid var(--primary);
}

.chat-main {
    display: flex;
    flex-direction: column;
    padding: 0;
    height: 100%;
    overflow: hidden;
}

/* Patient Info Header - Desktop */
.patient-info-header {
    background: linear-gradient(135deg, var(--primary), #0a6ba8);
    color: white;
    padding: 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.patient-info-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-wrap: wrap;
}

.patient-info-tab {
    padding: 16px 24px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    white-space: nowrap;
}

.patient-info-tab.active {
    color: white;
    background: rgba(255,255,255,0.1);
}

.patient-info-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: white;
}

.patient-info-content {
    padding: 20px;
    max-height: 200px;
    overflow-y: auto;
}

.patient-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    color: white;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 12px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 14px;
    font-weight: 500;
    word-break: break-word;
}

/* Mobile Header for Chat */
.chat-mobile-header {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--primary);
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.chat-mobile-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-mobile-patient {
    display: none;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.mobile-patient-name {
    font-weight: 600;
    font-size: 16px;
}

.mobile-patient-status {
    font-size: 12px;
    opacity: 0.9;
}

.patient-info-mobile-btn {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(255,255,255,0.1);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    margin: 0 20px 20px;
    width: calc(100% - 40px);
}

/* Mobile Responsive Chat */
@media (max-width: 1200px) {
    .chat-container {
        grid-template-columns: 1fr;
        height: 600px;
        border-radius: 12px;
    }
    
    .chat-sidebar {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1001;
        background: var(--bg);
    }
    
    .chat-sidebar.active {
        display: flex;
    }
    
    .chat-mobile-header {
        display: flex;
    }
    
    .chat-mobile-patient {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }
    
    .patient-info-header {
        display: none;
    }
    
    .patient-info-mobile-btn {
        display: flex;
    }
    
    .close-sidebar-btn {
        display: block !important;
    }
}

@media (max-width: 768px) {
    .chat-container {
        height: 500px;
        margin: 0 -15px;
        border-radius: 0;
        border: none;
        box-shadow: none;
    }
    
    #onlineChats.tab-content {
        padding: 0;
    }
    
    .chat-messages {
        padding: 15px;
    }
    
    .chat-input-area {
        padding: 15px;
    }
    
    .chat-actions {
        flex-wrap: wrap;
        padding: 10px;
    }
    
    .chat-action-btn {
        flex: 1 0 calc(50% - 10px);
        min-width: 120px;
        font-size: 12px;
        padding: 10px;
    }
}

/* Patient Info Modal */
.patient-info-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1002;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.patient-info-modal.active {
    display: flex;
}

.patient-info-modal-content {
    background: var(--bg);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.patient-info-modal-header {
    background: var(--primary);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1;
}

.patient-info-modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(80vh - 80px);
}

/* Close Button */
.close-sidebar-btn,
.close-modal-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.close-sidebar-btn:hover,
.close-modal-btn:hover {
    background: rgba(255,255,255,0.1);
}

/* Chat Messages */
.chat-messages-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--bg);
}

.message {
    max-width: 75%;
    padding: 14px 18px;
    border-radius: 18px;
    position: relative;
    animation: messageSlide 0.3s ease-out;
}

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

.message.sent {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.received {
    align-self: flex-start;
    background: var(--card-bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.chat-input-area {
    padding: 20px;
    border-top: 1px solid var(--border);
    background: var(--card-bg);
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.chat-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg);
    border-radius: 25px;
    padding: 0 16px;
    border: 1px solid var(--border);
}

.chat-input {
    flex: 1;
    padding: 14px 0;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 14px;
    outline: none;
}

/* Profile Section */
#myProfile .tab-content {
    max-width: 800px;
    margin: 0 auto;
}

/* Empty State Messages */
.no-chats {
    text-align: center;
    padding: 60px 20px;
    color: var(--text);
    opacity: 0.6;
}

.no-chats i {
    font-size: 48px;
    margin-bottom: 20px;
    color: var(--border);
}

.no-chats h4 {
    margin: 0 0 10px 0;
    color: var(--text);
    opacity: 0.8;
}

.no-chats p {
    margin: 0;
    font-size: 14px;
}

/* Scrollbar Styling */
.chat-list::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar,
.patient-info-content::-webkit-scrollbar,
.patient-info-modal-body::-webkit-scrollbar {
    width: 6px;
}

.chat-list::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track,
.patient-info-content::-webkit-scrollbar-track,
.patient-info-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.chat-list::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb,
.patient-info-content::-webkit-scrollbar-thumb,
.patient-info-modal-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.chat-list::-webkit-scrollbar-thumb:hover,
.chat-messages::-webkit-scrollbar-thumb:hover,
.patient-info-content::-webkit-scrollbar-thumb:hover,
.patient-info-modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}
