/* Component styles for DoctorConnect Interface 2025 */

/* Stats Cards */
.stats-card {
    background: white;
    border-radius: var(--dc-border-radius);
    padding: 1.5rem;
    box-shadow: var(--dc-shadow-sm);
    transition: var(--dc-transition-base);
    height: 100%;
}

.stats-card.compact {
    padding: 1rem;
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--dc-shadow);
}

.stats-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.stats-card.compact .stats-card-icon {
    width: 36px;
    height: 36px;
    font-size: 1.125rem;
    margin-bottom: 0;
    flex-shrink: 0;
}

.stats-card-title {
    font-size: 0.875rem;
    color: var(--dc-gray-600);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stats-card.compact .stats-card-title {
    font-size: 0.75rem;
    margin-bottom: 0.125rem;
}

.stats-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dc-gray-900);
    line-height: 1;
}

.stats-card.compact .stats-card-value {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

.stats-card-change {
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.stats-card.compact .stats-card-change {
    font-size: 0.75rem;
    margin-top: 0;
    margin-left: 0.25rem;
}

.stats-card-change.positive {
    color: var(--dc-success);
}

.stats-card-change.negative {
    color: var(--dc-danger);
}

/* Appointment List */
.appointment-item {
    border-bottom: 1px solid var(--dc-gray-200);
    padding: 1rem 0;
    transition: var(--dc-transition-base);
}

.appointment-item:last-child {
    border-bottom: none;
}

.appointment-item:hover {
    background-color: var(--dc-gray-50);
    margin: 0 -1.25rem;
    padding: 1rem 1.25rem;
}

.appointment-time {
    font-weight: 600;
    color: var(--dc-primary);
    margin-bottom: 0.25rem;
}

.appointment-patient {
    font-size: 1.125rem;
    color: var(--dc-gray-900);
    margin-bottom: 0.25rem;
}

.appointment-provider {
    color: var(--dc-gray-600);
    font-size: 0.875rem;
}

.appointment-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--dc-border-radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.appointment-status.confirmed {
    background-color: rgba(25, 135, 84, 0.1);
    color: var(--dc-success);
}

.appointment-status.unconfirmed {
    background-color: rgba(255, 193, 7, 0.1);
    color: var(--dc-warning);
}

.appointment-status.cancelled {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--dc-danger);
}

/* Message List */
.message-item {
    display: flex;
    align-items: start;
    padding: 1rem;
    border-bottom: 1px solid var(--dc-gray-200);
    transition: var(--dc-transition-base);
    cursor: pointer;
}

.message-item:last-child {
    border-bottom: none;
}

.message-item:hover {
    background-color: var(--dc-gray-50);
}

/* Add visual feedback that message area is clickable */
.message-item .message-content,
.message-item .message-type-icon,
.message-item .message-time,
.message-item .message-people {
    cursor: pointer;
}

/* Transition for read/unread state changes */
.message-item {
    transition: background-color 0.3s ease, border-left 0.3s ease;
}

.message-item.unread {
    background-color: rgba(13, 110, 253, 0.05);
    border-left: 3px solid var(--dc-primary);
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
}

.message-avatar i {
    font-size: 1.25rem;
    color: white;
}

/* Confirmation messages - Green circle with checkbox */
.message-avatar-confirmation {
    background-color: #198754; /* Bootstrap success green */
}

/* Reschedule messages - Red circle with X */
.message-avatar-reschedule {
    background-color: #dc3545; /* Bootstrap danger red */
}

/* Waitlist messages - Info blue circle with clock icon */
.message-avatar-waitlist {
    background-color: #0dcaf0; /* Bootstrap info cyan */
    color: #055160; /* Darker cyan for icon */
}

/* Appointment request messages - Blue circle with calendar */
.message-avatar-appointment-request {
    background-color: #0d6efd; /* Bootstrap primary blue */
}

/* Other messages - Yellow circle with envelope */
.message-avatar-other {
    background-color: #ffc107; /* Bootstrap warning yellow */
}

.message-avatar-other i {
    color: #000; /* Black icon on yellow background for better contrast */
}

/* MMS messages - Purple circle with image icon */
.message-avatar-mms {
    background-color: #d0b3ff; /* Even darker purple background */
    color: #6f42c1; /* Purple icon color */
}

/* WhatsApp messages - Green circle with WhatsApp icon */
.message-avatar-whatsapp {
    background-color: #25D366; /* WhatsApp green */
    color: white;
}

/* Form messages - Teal circle with clipboard icon */
.message-avatar-form {
    background-color: #20c997; /* Bootstrap teal */
    color: white;
}

/* Scan upload messages - Cyan circle with card-image icon */
.message-avatar-scan {
    background-color: #17a2b8; /* Cyan for scan uploads */
    color: white;
}

.message-content {
    flex: 1;
    min-width: 0;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.message-sender {
    font-weight: 600;
    color: var(--dc-gray-900);
}

.message-time {
    font-size: 0.875rem;
    color: var(--dc-gray-600);
}

.message-preview {
    color: var(--dc-gray-700);
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-item.unread .message-preview {
    font-weight: 500;
    color: var(--dc-gray-900);
}

/* Allow waitlist messages to wrap to multiple lines */
.message-item:has(.message-avatar-waitlist) .message-preview {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

/* Message Actions */
.message-actions {
    margin-left: auto;
    padding-left: 1rem;
    flex-shrink: 0;
}

/* Hide actions on desktop by default, show on hover */
@media (hover: hover) {
    .message-actions {
        visibility: hidden;
        opacity: 0;
        transition: visibility 0s linear 0.2s, opacity 0.2s ease;
    }
    
    .message-item:hover .message-actions {
        visibility: visible;
        opacity: 1;
        transition-delay: 0s;
    }
}

/* Always show actions on touch devices */
@media (hover: none) {
    .message-actions {
        visibility: visible;
        opacity: 1;
    }
}

.message-actions .btn-group-sm > .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}

.message-actions .btn-group-sm > .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.message-actions .dropdown-menu {
    min-width: 200px;
    border: 1px solid var(--dc-gray-300);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.message-actions .dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    transition: background-color 0.2s ease;
}

.message-actions .dropdown-item:hover {
    background-color: var(--dc-gray-100);
}

.message-actions .dropdown-item.active,
.message-actions .dropdown-item:active {
    background-color: var(--dc-primary);
    color: white;
}

/* Assignment status badges */
.message-header .badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Charts */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.chart-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

/* Navigation Menu */
.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-menu-item {
    margin-bottom: 0.25rem;
}

.nav-menu-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--dc-gray-700);
    text-decoration: none;
    border-radius: var(--dc-border-radius);
    transition: var(--dc-transition-base);
    gap: 0.75rem;
}

.nav-menu-link:hover {
    background-color: var(--dc-gray-100);
    color: var(--dc-primary);
}

.nav-menu-link.active {
    background-color: rgba(13, 110, 253, 0.1);
    color: var(--dc-primary);
    font-weight: 600;
}

.nav-menu-icon {
    font-size: 1.25rem;
    width: 1.25rem;
    text-align: center;
}

.nav-menu-badge {
    margin-left: auto;
    background-color: var(--dc-danger);
    color: white;
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    font-weight: 600;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.action-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--dc-border-color);
    border-radius: var(--dc-border-radius);
    background-color: white;
    color: var(--dc-gray-700);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--dc-transition-base);
    cursor: pointer;
}

.action-button:hover {
    background-color: var(--dc-gray-100);
    border-color: var(--dc-gray-400);
    color: var(--dc-gray-900);
}

.action-button.primary {
    background-color: var(--dc-primary);
    border-color: var(--dc-primary);
    color: white;
}

.action-button.primary:hover {
    background-color: var(--dc-primary-dark);
    border-color: var(--dc-primary-dark);
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem;
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--dc-gray-400);
    margin-bottom: 1rem;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dc-gray-900);
    margin-bottom: 0.5rem;
}

.empty-state-text {
    color: var(--dc-gray-600);
    margin-bottom: 1.5rem;
}

/* Loading Animations */
.loading-dots {
    display: inline-flex;
    gap: 0.25rem;
}

.loading-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--dc-primary);
    animation: loading-dot 1.4s infinite ease-in-out both;
}

.loading-dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes loading-dot {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Remove underlines from navigation links */
.navbar-nav .nav-link {
    text-decoration: none !important;
}

.navbar-nav .nav-link:hover {
    text-decoration: none !important;
    color: white !important;
}

/* Remove underlines from sidebar navigation menu */
.nav-menu-link {
    text-decoration: none !important;
}

.nav-menu-link:hover {
    text-decoration: none !important;
}

/* Remove underlines from dropdown menu items */
.dropdown-menu .dropdown-item {
    text-decoration: none !important;
}

.dropdown-menu .dropdown-item:hover {
    text-decoration: none !important;
    background-color: rgba(13, 110, 253, 0.15) !important;
}

/* Responsive Components */
@media (max-width: 768px) {
    .stats-card {
        padding: 1rem;
    }
    
    .stats-card-value {
        font-size: 1.5rem;
    }
    
    .appointment-item:hover {
        margin: 0;
        padding: 1rem 0;
    }
    
    .message-avatar {
        width: 32px;
        height: 32px;
    }
    
    .chart-container {
        height: 250px;
    }
    
    .nav-menu-link {
        padding: 0.625rem 0.75rem;
        font-size: 0.875rem;
    }
}