/* SlackDigest custom styles */

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Active nav/channel highlight */
.nav-link.active {
    background-color: #ede9fe;
    color: #7c3aed;
    font-weight: 600;
}

.channel-link.active {
    background-color: #ede9fe;
    color: #7c3aed;
    font-weight: 600;
}

/* Message styles */
.message-row {
    padding: 6px 20px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.message-row:hover {
    background-color: #f9fafb;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    flex-shrink: 0;
    background-color: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: #6b7280;
    overflow: hidden;
}
.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 2px;
}
.message-author {
    font-weight: 700;
    font-size: 15px;
    color: #1a1d21;
}
.message-time {
    font-size: 12px;
    color: #9ca3af;
}

.message-text {
    font-size: 15px;
    line-height: 1.46;
    color: #1d1c1d;
    word-break: break-word;
}
.message-text code {
    background: #f3f4f6;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 13px;
    color: #e01e5a;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
.message-text pre {
    background: #1a1d21;
    color: #e8e6e3;
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 4px 0;
    font-size: 13px;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
.message-text pre code {
    background: none;
    color: inherit;
    padding: 0;
}
.message-text blockquote {
    border-left: 4px solid #ddd;
    padding-left: 12px;
    margin: 4px 0;
    color: #666;
}
.message-text a {
    color: #1264a3;
    text-decoration: none;
}
.message-text a:hover {
    text-decoration: underline;
}

/* System messages (join/leave/etc) */
.message-system {
    padding: 4px 20px 4px 68px;
    font-size: 13px;
    color: #9ca3af;
    font-style: italic;
}

/* Date separator */
.date-separator {
    display: flex;
    align-items: center;
    padding: 16px 20px 8px;
    gap: 12px;
}
.date-separator::before,
.date-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}
.date-separator span {
    font-size: 13px;
    font-weight: 600;
    color: #1d1c1d;
    white-space: nowrap;
}

/* Thread indicator */
.thread-indicator {
    margin-left: 48px;
    padding: 4px 12px;
    font-size: 13px;
    color: #1264a3;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: 6px;
}
.thread-indicator:hover {
    background-color: #f0f4ff;
}

/* Thread replies container */
.thread-replies {
    margin-left: 48px;
    border-left: 2px solid #e5e7eb;
    padding-left: 12px;
    margin-bottom: 4px;
}
.thread-replies .message-row {
    padding: 4px 8px;
}
.thread-replies .message-avatar {
    width: 28px;
    height: 28px;
    font-size: 11px;
}

/* Attachment */
.attachment-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-top: 4px;
    max-width: 400px;
}
.attachment-icon {
    width: 32px;
    height: 32px;
    background: #f3f4f6;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Channel header */
.channel-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

/* Stat cards */
.stat-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
}
.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #7c3aed;
}
.stat-card .stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 4px;
}

/* Bar chart */
.bar-chart .bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.bar-chart .bar-label {
    width: 140px;
    font-size: 13px;
    color: #374151;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}
.bar-chart .bar-fill {
    height: 22px;
    background: #7c3aed;
    border-radius: 3px;
    transition: width 0.3s ease;
    min-width: 2px;
}
.bar-chart .bar-count {
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
    flex-shrink: 0;
}

/* User card */
.user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: box-shadow 0.15s;
}
.user-card:hover {
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-color: #d1d5db;
}

/* Search result */
.search-result {
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
}
.search-result:hover {
    background: #f9fafb;
}
.search-result mark {
    background: #fef08a;
    padding: 0 2px;
    border-radius: 2px;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 16px;
}
.pagination button {
    padding: 6px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    background: white;
    cursor: pointer;
    color: #374151;
}
.pagination button:hover:not(:disabled) {
    background: #f3f4f6;
}
.pagination button:disabled {
    opacity: 0.4;
    cursor: default;
}
.pagination button.active {
    background: #7c3aed;
    color: white;
    border-color: #7c3aed;
}

/* Loading spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e5e7eb;
    border-top-color: #7c3aed;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mobile sidebar */
@media (max-width: 767px) {
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        z-index: 40;
        transition: left 0.2s ease;
        padding-top: 52px;
    }
    .sidebar.open {
        left: 0;
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.3);
        z-index: 39;
    }
    .sidebar-overlay.open {
        display: block;
    }
}
