/* TG-Watcher Stylesheet */

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    background-color: #0e1621;
    color: #f5f5f5;
}
a { color: #6ab2f2; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.header {
    background: #17212b;
    color: #fff;
    padding: 10px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #232e3c;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.header a { color: #fff; font-weight: 500; font-size: 15px; }
.header a:hover { text-decoration: none; opacity: 0.9; }
.header-nav { display: flex; gap: 16px; }
.header-nav a { font-size: 14px; font-weight: 400; }

/* Main container */
.main { max-width: 800px; margin: 0 auto; padding: 12px; }
.main-wide { max-width: 1000px; }

/* Breadcrumb */
.breadcrumb { font-size: 13px; color: #7d8b99; margin-bottom: 8px; }
.breadcrumb a { color: #6ab2f2; }

/* Page title */
.page-title { font-size: 18px; font-weight: 600; margin-bottom: 4px; color: #f5f5f5; }
.page-subtitle { font-size: 13px; color: #7d8b99; margin-bottom: 12px; }

/* Channel list */
.channel-list { background: #17212b; border-radius: 8px; overflow: hidden; }
.channel-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #232e3c;
    transition: background 0.15s;
}
.channel-item:last-child { border-bottom: none; }
.channel-item:hover { background: #202b36; }
.channel-avatar {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5288c1, #6ab2f2);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 600; font-size: 16px;
    margin-right: 12px; flex-shrink: 0;
}
.channel-info { flex: 1; min-width: 0; }
.channel-title { font-weight: 500; color: #f5f5f5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-meta { font-size: 13px; color: #7d8b99; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-badge {
    font-size: 11px; background: #3a4a5a; color: #aab8c5;
    padding: 2px 6px; border-radius: 10px; margin-left: 6px;
}
.channel-stats { text-align: right; font-size: 12px; color: #7d8b99; flex-shrink: 0; margin-left: 8px; }

/* Messages */
.message-list { display: flex; flex-direction: column; gap: 2px; }
.message {
    background: #17212b;
    padding: 8px 12px;
    border-radius: 6px;
}
.message-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 2px;
}
.message-sender { font-weight: 500; color: #6ab2f2; font-size: 13px; }
.message-time { font-size: 12px; color: #7d8b99; }
.message-badge {
    font-size: 10px; background: #2b3a4a; color: #7d8b99;
    padding: 1px 5px; border-radius: 3px;
}
.message-text { word-break: break-word; line-height: 1.5; color: #f5f5f5; }
.message-text p { margin-bottom: 0.4em; }
.message-text p:last-child { margin-bottom: 0; }
.message-empty { color: #7d8b99; font-style: italic; font-size: 13px; }

/* Reply preview */
.message-reply {
    display: flex;
    gap: 8px;
    padding: 6px 0 6px 0;
    margin: 4px 0 6px 0;
    text-decoration: none;
    color: inherit;
}
.message-reply:hover { opacity: 0.8; }
.reply-bar {
    width: 3px;
    background: #6ab2f2;
    border-radius: 2px;
    flex-shrink: 0;
}
.reply-content {
    flex: 1;
    min-width: 0;
}
.reply-sender {
    font-size: 12px;
    font-weight: 500;
    color: #6ab2f2;
    margin-bottom: 2px;
}
.reply-text {
    font-size: 13px;
    color: #aab8c5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.reply-text em { color: #7d8b99; font-style: italic; }

/* Media in messages */
.message-media { margin: 8px 0; max-width: 400px; position: relative; }
.message-media a { display: block; cursor: pointer; }
.message-media img {
    max-width: 100%;
    border-radius: 8px;
    display: block;
    transition: opacity 0.2s;
}
.message-media a:hover img { opacity: 0.85; }
.video-indicator {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

/* Attachments (documents, audio, etc.) */
.message-attachment { margin: 8px 0; }
.attachment-label {
    display: inline-block;
    background: #17212b;
    border: 1px solid #232e3c;
    padding: 8px 12px;
    border-radius: 6px;
    color: #7d8b99;
    font-size: 13px;
    font-style: italic;
}

/* Spoiler */
.spoiler {
    background-color: #3a4a5a;
    color: transparent;
    border-radius: 4px;
    padding: 0 3px;
    cursor: pointer;
    transition: all 0.2s;
}
.spoiler:hover { background-color: transparent; color: inherit; }

/* Filter box */
.filter-box {
    background: #17212b;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.filter-box label { font-size: 13px; color: #7d8b99; }
.filter-box input[type="date"] {
    background: #0e1621;
    border: 1px solid #232e3c;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 13px;
    font-family: inherit;
    color: #f5f5f5;
    color-scheme: dark;
}
.btn {
    background: #5288c1;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 5px 12px;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}
.btn:hover { background: #6ab2f2; }
.btn-secondary { background: #2b3a4a; color: #aab8c5; }
.btn-secondary:hover { background: #3a4a5a; }

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    padding: 4px 10px;
    font-size: 13px;
    border-radius: 4px;
}
.pagination a { background: #17212b; color: #6ab2f2; }
.pagination a:hover { background: #202b36; text-decoration: none; }
.pagination .active { background: #5288c1; color: #fff; }
.pagination .ellipsis { color: #7d8b99; }
.pagination-info { font-size: 12px; color: #7d8b99; text-align: center; margin-top: 6px; }

/* User profile */
.profile-grid { display: grid; grid-template-columns: 280px 1fr; gap: 12px; }
@media (max-width: 700px) { .profile-grid { grid-template-columns: 1fr; } }
.card { background: #17212b; border-radius: 8px; overflow: hidden; }
.card-header { padding: 10px 12px; border-bottom: 1px solid #232e3c; font-weight: 500; font-size: 14px; color: #f5f5f5; }
.card-body { padding: 10px 12px; }
.info-table { width: 100%; font-size: 13px; }
.info-table th { color: #7d8b99; font-weight: 400; padding: 4px 8px 4px 0; width: 100px; }
.info-table td { padding: 4px 0; color: #f5f5f5; }
.info-table code { background: #0e1621; padding: 1px 4px; border-radius: 3px; font-size: 12px; color: #6ab2f2; }
.stat-item { margin-bottom: 6px; font-size: 13px; color: #f5f5f5; }
.stat-item:last-child { margin-bottom: 0; }

/* Activity table */
.activity-table { width: 100%; font-size: 13px; border-collapse: collapse; }
.activity-table th { text-align: left; padding: 8px; border-bottom: 1px solid #232e3c; color: #7d8b99; font-weight: 500; }
.activity-table td { padding: 8px; border-bottom: 1px solid #1c2733; color: #f5f5f5; }
.activity-table tr:last-child td { border-bottom: none; }

/* Empty state */
.empty-state {
    background: #17212b;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    color: #7d8b99;
}
.empty-state code { background: #0e1621; padding: 2px 6px; border-radius: 4px; color: #6ab2f2; }
