/* Telemedicine Chat Widget Styles */
.tm-widget-container {
    position: fixed;
    bottom: 20px;
    left: 20px; /* Positioned left as requested */
    z-index: 999999;
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Floating Button */
.tm-floating-btn {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #0ba360 0%, #3cba92 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(11, 163, 96, 0.4);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
    position: relative;
}
.tm-floating-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(11, 163, 96, 0.6);
}
.tm-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ff3b30;
    color: white;
    font-size: 12px;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* Popup Container */
.tm-popup {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 350px;
    height: 500px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #f0f0f0;
}

/* Header */
.tm-popup-header {
    background: linear-gradient(135deg, #0ba360 0%, #3cba92 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
.tm-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.tm-back-btn {
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
}
#tm-header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.5);
}
.tm-header-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: white;
}
.tm-header-info span {
    font-size: 12px;
    opacity: 0.9;
}
.tm-header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}
#tm-timer {
    background: rgba(0,0,0,0.2);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 13px;
    font-family: monospace;
    font-weight: bold;
}
.tm-close-btn {
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
}
.tm-close-btn:hover {
    opacity: 1;
}

/* Views */
.tm-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f8f9fa;
}

/* Doctor List */
.tm-doctor-list {
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.tm-doctor-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    transition: transform 0.2s;
}
.tm-doctor-card:hover {
    transform: translateY(-2px);
    border-color: #0ba360;
}
.tm-doctor-card img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}
.tm-doctor-info {
    flex: 1;
    position: relative;
}
.tm-doctor-info h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    color: #333;
    font-weight: 600;
}
.tm-doctor-info p {
    margin: 0;
    font-size: 12px;
    color: #777;
}
.tm-status.online {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #4cd964;
    border-radius: 50%;
    position: absolute;
    top: 5px;
    right: 0;
}
.tm-btn-consult {
    background: #e8f5e9;
    color: #0ba360;
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}
.tm-btn-consult:hover {
    background: #c8e6c9;
}

/* Chat Messages */
.tm-chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #f0f2f5;
}
.tm-message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
}
.tm-received {
    align-self: flex-start;
}
.tm-sent {
    align-self: flex-end;
}
.tm-system {
    align-self: center;
    max-width: 90%;
}
.tm-system span {
    background: rgba(0,0,0,0.1);
    color: #555;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 11px;
    text-align: center;
    display: inline-block;
}
.tm-bubble {
    padding: 10px 15px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
}
.tm-received .tm-bubble {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.tm-sent .tm-bubble {
    background: #0ba360;
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Chat Input */
.tm-chat-input-area {
    padding: 12px 15px;
    background: white;
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: 1px solid #eee;
}
#tm-chat-input {
    flex: 1;
    background: #f0f2f5;
    border: none;
    padding: 12px 15px;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
}
#tm-chat-send {
    background: #0ba360;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
}
#tm-chat-send:hover {
    transform: scale(1.1);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .tm-popup {
        width: 100%;
        height: 100vh;
        bottom: 0;
        left: 0;
        border-radius: 0;
    }
    .tm-widget-container {
        left: 0;
        bottom: 0;
        width: 100%;
    }
    .tm-floating-btn {
        position: fixed;
        bottom: 20px;
        left: 20px;
    }
}
