/* ============================================
   Dorevo Institute — Shared Components
   Micro-interactions, textures, avatars, etc.
   ============================================ */

/* --- Medical Background Texture --- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 40'%3E%3Cpath d='M0 20h120l10-15 12 30 12-25 10 10h226' fill='none' stroke='%23E5E4E0' stroke-width='0.5'/%3E%3C/svg%3E");
    background-size: 400px 40px;
    background-repeat: repeat-x;
    background-position: bottom;
    opacity: 0.3;
    pointer-events: none;
    z-index: -1;
}

/* --- Header Search (Global) --- */
.header-search {
    flex: 1;
    max-width: 480px;
    position: relative;
}

.header-search input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.75rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-full);
    font: 400 0.875rem/1.4 var(--font-body);
    color: var(--color-text);
    background: var(--color-surface);
    transition: all 0.2s var(--ease-out);
}

.header-search input:focus {
    outline: none;
    border-color: var(--color-teal);
    box-shadow: 0 0 0 3px rgba(30, 68, 89, 0.1);
    background: var(--color-white);
}

.header-search .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
}

/* --- Notification Button --- */
.notification-btn {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: transparent;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: background 0.15s;
}

.notification-btn:hover {
    background: var(--color-surface-alt);
}

.notification-btn .badge-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--color-coral);
    border-radius: var(--radius-full);
    border: 2px solid var(--color-white);
}

/* --- Avatar Component --- */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font: 600 0.85rem/1 var(--font-display);
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.1rem; }
.avatar-xl { width: 72px; height: 72px; font-size: 1.3rem; }

.avatar-teal { background: var(--color-teal); }
.avatar-coral { background: var(--color-coral); }
.avatar-tinto { background: var(--color-tinto); }

/* Avatar with online indicator */
.avatar-status {
    position: relative;
}

.avatar-status::after {
    content: '';
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 10px;
    height: 10px;
    background: var(--color-success);
    border-radius: var(--radius-full);
    border: 2px solid var(--color-white);
}

/* --- User Card (for discussions) --- */
.user-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-card-info {
    min-width: 0;
}

.user-card-name {
    font: 500 0.875rem/1.3 var(--font-body);
    color: var(--color-text);
}

.user-card-role {
    font: 400 0.75rem/1.3 var(--font-body);
    color: var(--color-text-muted);
}

/* --- Discussion / Comments --- */
.comment-item {
    display: flex;
    gap: 1rem;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--color-border-subtle);
}

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

.comment-body {
    flex: 1;
    min-width: 0;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.comment-author {
    font: 500 0.875rem/1.3 var(--font-body);
    color: var(--color-text);
}

.comment-time {
    font: 400 0.75rem/1.3 var(--font-body);
    color: var(--color-text-light);
}

.comment-text {
    font: 400 0.9rem/1.6 var(--font-body);
    color: var(--color-text-secondary);
    margin: 0;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
}

.comment-action {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: none;
    border: none;
    font: 400 0.8rem/1 var(--font-body);
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0.25rem 0;
    transition: color 0.15s;
}

.comment-action:hover {
    color: var(--color-coral);
}

.comment-action .material-icons-outlined {
    font-size: 16px;
}

/* --- Notification Indicator --- */
.notification-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--color-surface);
    border-radius: var(--radius-md);
    font: 400 0.85rem/1.3 var(--font-body);
    color: var(--color-text-secondary);
    border-left: 3px solid var(--color-coral);
}

/* --- Divider with text --- */
.divider-text {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--color-text-light);
    font: 500 0.75rem/1 var(--font-body);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 1.5rem 0;
}

.divider-text::before,
.divider-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

/* --- Quick Stats Row --- */
.quick-stats {
    display: flex;
    gap: 1.5rem;
    padding: 1rem 0;
}

.quick-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quick-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-stat-icon.teal  { background: rgba(30, 68, 89, 0.1); color: var(--color-teal); }
.quick-stat-icon.coral { background: rgba(106,16,47,0.1); color: var(--color-coral); }
.quick-stat-icon.green { background: rgba(45, 156, 111, 0.1); color: var(--color-success); }

.quick-stat-value {
    font: 600 1.1rem/1 var(--font-display);
    color: var(--color-text);
}

.quick-stat-label {
    font: 400 0.75rem/1.3 var(--font-body);
    color: var(--color-text-muted);
}

/* --- Hover Lift Effect (utility) --- */
.hover-lift {
    transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(30, 68, 89, 0.08);
}

/* --- Focus Ring (utility) --- */
.focus-ring:focus-visible {
    outline: 2px solid var(--color-teal);
    outline-offset: 2px;
}

/* --- Truncate text (utility) --- */
.truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
