/* Custom styles for Clinic Management System */

:root {
    --primary-color: #3b82f6;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
}

/* Smooth animations */
a,
button,
input,
select,
textarea,
.card-hover {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

/* Card hover effects */
.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Loading spinner */
.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Fade in animation */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Slide in from right */
.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Toast notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    animation: slideInRight 0.5s ease-out;
}

/* Patient banner sticky */
.patient-banner {
    position: sticky;
    top: 0;
    z-index: 100;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Queue status colors */
.queue-waiting { background-color: #fef3c7; color: #92400e; }
.queue-called { background-color: #dbeafe; color: #1e40af; }
.queue-in-service { background-color: #d1fae5; color: #065f46; }
.queue-done { background-color: #f3f4f6; color: #6b7280; }

/* Priority badges */
.priority-high { background-color: #fee2e2; color: #991b1b; }
.priority-medium { background-color: #fef3c7; color: #92400e; }
.priority-low { background-color: #dbeafe; color: #1e40af; }

/* Floating chat button */
.floating-chat-btn {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9998;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, #2563eb, #38bdf8);
    color: #fff;
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.35);
    text-decoration: none;
    font-weight: 600;
}

.floating-chat-btn:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 18px 36px rgba(37, 99, 235, 0.45);
}

.floating-chat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(6px);
    font-size: 18px;
    position: relative;
    overflow: hidden;
}

.floating-chat-icon::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    animation: chatPulse 2.2s ease-out infinite;
}

.floating-chat-label {
    font-size: 14px;
    letter-spacing: 0.3px;
}

@keyframes chatPulse {
    0% {
        transform: scale(0.7);
        opacity: 0.8;
    }
    70% {
        transform: scale(1.3);
        opacity: 0;
    }
    100% {
        opacity: 0;
    }
}

.chat-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.25);
    display: none;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 24px;
    z-index: 9999;
}

.chat-modal-overlay.active {
    display: flex;
}

.chat-modal-panel {
    width: min(420px, 92vw);
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: chatPanelIn 0.2s ease-out;
}

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

.chat-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid #e5e7eb;
}

.chat-modal-close {
    border: none;
    background: #f3f4f6;
    color: #374151;
    border-radius: 10px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.chat-modal-close:hover {
    background: #e5e7eb;
}

.chat-modal-body {
    padding: 16px;
    background: #f8fafc;
    max-height: 340px;
    overflow-y: auto;
}

.chat-bubble {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.chat-bubble.user {
    justify-content: flex-end;
}

.chat-bubble .avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #e0f2fe;
    color: #0369a1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
}

.chat-bubble.user .avatar {
    display: none;
}

.chat-bubble .bubble-content {
    background: #fff;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 14px;
    color: #334155;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    max-width: 260px;
}

.chat-bubble.user .bubble-content {
    background: #2563eb;
    color: #fff;
}

.bubble-hint {
    margin-top: 6px;
    font-size: 12px;
    color: #94a3b8;
}

.chat-modal-footer {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid #e5e7eb;
}

.chat-modal-footer input {
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14px;
}

.chat-modal-footer button {
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 600;
}

.chat-modal-footer button:hover {
    background: #1d4ed8;
}

.chat-modal-note {
    font-size: 11px;
    color: #94a3b8;
    padding: 0 16px 12px 16px;
}

.nav-scroll {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.6) transparent;
}

.nav-scroll::-webkit-scrollbar {
    height: 6px;
}

.nav-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.nav-scroll::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.6);
    border-radius: 999px;
}

@media (max-width: 640px) {
    .floating-chat-btn {
        right: 16px;
        bottom: 16px;
        padding: 10px 12px;
    }
    .floating-chat-label {
        display: none;
    }
    .chat-modal-overlay {
        padding: 12px;
    }
    .chat-modal-panel {
        width: 100%;
    }
}
