/* public/css/dashboard.css */

.dashboard-content {
    padding: 30px;
    flex-grow: 1;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.dashboard-header h1 {
    font-size: 2.2em;
    color: #1e293b;
    font-weight: 700;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.stat-card {
    background-color: #fff;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 20px;
    border: 1px solid #e2e8f0;
}

.stat-card .stat-icon {
    font-size: 1.8em;
    background-color: #f8fafc;
    color: #64748b;
    border-radius: 12px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card .stat-info {
    display: flex;
    flex-direction: column;
}

.stat-card .number {
    font-size: 2em;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.1;
}

.stat-card .label {
    font-size: 0.9em;
    color: #64748b;
    font-weight: 500;
}

.patient-list-container {
    background-color: #fff;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
}

.patient-list-container h2 {
    margin-bottom: 25px;
    font-size: 1.6em;
    color: #1e293b;
    font-weight: 700;
}

.patient-card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.patient-card {
    display: grid;
    grid-template-columns: 2fr 2.5fr 1fr auto; 
    align-items: center;
    padding: 15px 20px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.2s ease-in-out;
    gap: 20px;
}

.patient-card:hover {
    border-color: #c7d2fe;
    background-color: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.patient-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.patient-info .name {
    font-weight: 600;
    font-size: 1.1em;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wear-status-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #94a3b8;
}

.status-dot.status-in {
    background-color: #22c55e;
}

.status-dot.status-out {
    background-color: #f97316;
}

.status-text {
    font-size: 0.7em;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    line-height: 1;
}

.patient-progress-details {
    display: flex;
    gap: 20px;
    font-size: 0.9em;
    color: #475569;
}

.progress-item strong {
    color: #1e293b;
}

.patient-status {
    display: flex;
    justify-content: center;
}

.patient-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.action-btn {
    padding: 8px 14px;
    font-size: 0.9em;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.view-tracker-btn {
    background-color: #4f46e5;
    color: white;
}
.view-tracker-btn:hover {
    background-color: #4338ca;
}

.review-report-btn {
    background-color: #f59e0b;
    color: white;
}
.review-report-btn:hover {
    background-color: #d97706;
}

.edit-btn {
    background-color: #f1f5f9;
    color: #334155;
}
.edit-btn:hover {
    background-color: #e2e8f0;
}

.archive-btn {
    background-color: #f1f5f9;
    color: #ef4444;
}
.archive-btn:hover {
    background-color: #fee2e2;
}

.unarchive-btn {
    background-color: #f1f5f9;
    color: #059669;
}
.unarchive-btn:hover {
    background-color: #d1fae5;
}

.status-badge {
    padding: 5px 12px;
    border-radius: 9999px;
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.status-badge.active {
    background-color: #dcfce7;
    color: #166534;
}

.status-badge.pending-invite {
    background-color: #f1f5f9;
    color: #475569;
}

.status-badge.review-needed {
    background-color: #fef9c3;
    color: #854d0e;
    animation: pulse-animation 2s infinite;
}

.status-badge.archived {
    background-color: #e2e8f0;
    color: #475569;
}

.patient-card.archived {
    background-color: #f8fafc;
    opacity: 0.65;
}

.patient-card.archived:hover {
    opacity: 1;
    background-color: #f1f5f9;
}

.patient-flags {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.attention-flag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.78em;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.attention-flag .attention-icon {
    font-size: 0.9em;
}

.attention-flag .attention-text {
    line-height: 1;
}

.attention-flag--message {
    background-color: #eef2ff;
    color: #3730a3;
}

.attention-flag--report {
    background-color: #fff7ed;
    color: #9a3412;
}

.patient-card.needs-review {
    border-color: #fbbf24;
    box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.15);
}

.patient-card.has-message {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.patient-card.has-message.needs-review {
    border-color: #4c1d95;
    box-shadow: 0 0 0 2px rgba(76, 29, 149, 0.2);
}

.patient-card.needs-review:hover {
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25), 0 4px 12px rgba(0,0,0,0.05);
}

.patient-card.has-message:hover {
    border-color: #4f46e5;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.3), 0 4px 12px rgba(0,0,0,0.05);
}

.patient-card.has-message.needs-review:hover {
    border-color: #4338ca;
    box-shadow: 0 0 0 2px rgba(67, 56, 202, 0.3), 0 4px 12px rgba(0,0,0,0.05);
}

@keyframes pulse-animation {
  0% { box-shadow: 0 0 0 0 rgba(254, 249, 195, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(254, 249, 195, 0); }
  100% { box-shadow: 0 0 0 0 rgba(254, 249, 195, 0); }
}

@media (max-width: 900px) {
    .patient-card {
        grid-template-columns: 1fr;
        gap: 15px;
        text-align: center;
    }
    .patient-info, .patient-progress-details, .patient-actions {
        justify-content: center;
    }
    .patient-progress-details {
        flex-wrap: wrap;
    }
    .patient-flags {
        justify-content: center;
    }
}

/* Unread Message Notification Dot */
.message-btn {
    position: relative;
}

.notification-dot {
    position: absolute;
    top: 2px; /* Adjusted position */
    right: 2px; /* Adjusted position */
    width: 12px; /* Increased size */
    height: 12px; /* Increased size */
    background-color: var(--primary-color, #667eea);
    border-radius: 50%;
    border: 2px solid white;
    animation: pulse-dot 2s infinite; /* Added animation */
}

/* Keyframes for the pulsing animation */
@keyframes pulse-dot {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(var(--primary-rgb, 102, 126, 234), 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(var(--primary-rgb, 102, 126, 234), 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(var(--primary-rgb, 102, 126, 234), 0);
    }
}