/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.bot-filter-toggle {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    color: var(--text);
    font-size: 1rem;
}

.toggle-label i {
    color: var(--danger);
}

.bot-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border-left: 3px solid var(--warning);
}

.bot-info i {
    color: var(--warning);
}

:root {
    --primary: #9146ff;
    --primary-dark: #772ce8;
    --primary-light: #bf94ff;
    --secondary: #0e0e10;
    --surface: #1f1f23;
    --surface-light: #2a2a2e;
    --surface-dark: #18181b;
    --text: #efeff1;
    --text-secondary: #adadb8;
    --text-tertiary: #7a7a85;
    --success: #00ff7f;
    --warning: #ffaa00;
    --danger: #ff5555;
    --info: #00bfff;
    --youtube: #ff0000;
    --instagram: #e4405f;
    --twitter: #1da1f2;
    --twitch: #9146ff;
    --tiktok: #ffffff;
    --border: rgba(255, 255, 255, 0.1);
    --border-light: rgba(255, 255, 255, 0.05);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --radius: 12px;
    --radius-sm: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--secondary);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Header */
header {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-dark) 100%);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 10px;
}

h1 {
    font-size: 2.8rem;
    margin-bottom: 10px;
    background: linear-gradient(45deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* Alert */
.alert {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.alert-info {
    background: rgba(0, 191, 255, 0.1);
    border: 1px solid rgba(0, 191, 255, 0.3);
    color: var(--info);
}

.alert i {
    font-size: 1.5rem;
}

/* Main Layout */
main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.content-section {
    grid-column: 1;
}

/* Configuration Section */
.config-section {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 25px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.connection-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border);
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--danger);
    position: relative;
}

.status-dot::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.7; }
    70% { transform: scale(2); opacity: 0; }
    100% { transform: scale(2); opacity: 0; }
}

.status-dot.connected {
    background: var(--success);
    animation: none;
}

.status-dot.connected::after {
    display: none;
}

.connection-time {
    margin-left: auto;
    font-family: 'Monaco', 'Courier New', monospace;
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

.channel-input {
    display: flex;
    gap: 10px;
    align-items: center;
}

.input-with-icon {
    flex: 1;
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
}

.input-with-icon input {
    width: 100%;
    padding: 14px 15px 14px 45px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-with-icon input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(145, 70, 255, 0.1);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(145, 70, 255, 0.3);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-danger {
    background: rgba(255, 85, 85, 0.1);
    color: var(--danger);
    border: 2px solid var(--danger);
}

.btn-danger:hover:not(:disabled) {
    background: rgba(255, 85, 85, 0.2);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.btn-warning {
    background: rgba(255, 170, 0, 0.1);
    color: var(--warning);
    border: 2px solid var(--warning);
}

.btn-warning:hover {
    background: rgba(255, 170, 0, 0.2);
    transform: translateY(-2px);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
    gap: 8px;
}

/* Filter Section */
.filter-section {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-bottom: 20px;
}

.filter-section h3 {
    margin-bottom: 10px;
    color: var(--text);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.filter-checkboxes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-checkbox {
    display: none;
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    font-weight: 500;
}

.filter-label:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.filter-checkbox:checked + .filter-label {
    border-color: currentColor;
    background: rgba(255, 255, 255, 0.1);
}

/* Platform-specific label colors */
.filter-label.youtube {
    color: var(--youtube);
}

.filter-label.instagram {
    color: var(--instagram);
}

.filter-label.twitter {
    color: var(--twitter);
}

.filter-label.twitch {
    color: var(--twitch);
}

.filter-label.tiktok {
    color: var(--tiktok);
}

.filter-label.other {
    color: var(--text-secondary);
}

.filter-label i {
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}

.filter-actions {
    display: flex;
    gap: 10px;
}

/* User Filter */
.user-filter-section {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-bottom: 20px;
}

.user-filter-input {
    display: flex;
    gap: 15px;
    align-items: center;
}

.user-filter-stats {
    padding: 8px 16px;
    background: rgba(145, 70, 255, 0.1);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--primary-light);
    white-space: nowrap;
}

/* Data Management */
.data-management {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-bottom: 20px;
}

.data-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.data-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.data-info p {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.storage-info {
    display: flex;
    gap: 20px;
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

/* Quick Stats */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.stat-card {
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-sm);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    background: rgba(0, 0, 0, 0.4);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.messages {
    background: rgba(0, 191, 255, 0.1);
    color: var(--info);
}

.stat-icon.links {
    background: rgba(145, 70, 255, 0.1);
    color: var(--primary);
}

.stat-icon.users {
    background: rgba(0, 255, 127, 0.1);
    color: var(--success);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Clicked filter inline di tab header */
.clicked-filter-inline {
    display: flex;
    gap: 10px;
    align-items: center;
}

.clicked-filter-inline .filter-option {
    margin: 0;
}

.clicked-filter-inline .filter-label {
    padding: 8px 12px;
    font-size: 0.9rem;
}

/* Slow Mode Toggle */
.slow-mode-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-sm);
}

.slow-mode-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: 5px;
    border: 1px solid var(--border);
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    position: relative;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.tab-btn.active {
    background: rgba(145, 70, 255, 0.1);
    color: var(--primary);
}

.tab-badge {
    background: var(--primary);
    color: white;
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}

.tab-btn.active .tab-badge {
    background: white;
    color: var(--primary);
}

/* Tab Content */
.tab-content {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    min-height: 600px;
    overflow: hidden;
}

.tab-pane {
    display: none;
    height: 100%;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tab-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
}

.tab-header h3 {
    font-size: 1.3rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.tab-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-box {
    position: relative;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
}

.search-box input {
    padding: 10px 15px 10px 40px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.9rem;
    width: 200px;
}

.filter-summary {
    padding: 15px 25px;
    background: rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Links Container */
.links-container {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 800px;
    overflow-y: auto;
}

.link-card {
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-sm);
    padding: 20px;
    border-left: 4px solid var(--primary);
    animation: slideIn 0.3s ease;
    transition: all 0.3s ease;
    position: relative;
}

/* Link clicked indicator */
.link-card.clicked {
    opacity: 0.8;
    border-left-color: var(--text-tertiary);
    background: rgba(255, 255, 255, 0.02);
}

.link-card.clicked .link-url {
    text-decoration: line-through;
    color: var(--text-tertiary);
}

.link-card.clicked::after {
    content: '✓ Viewed';
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 255, 127, 0.1);
    color: var(--success);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.link-card:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: translateX(5px);
}

.link-card.clicked:hover {
    background: rgba(0, 0, 0, 0.3);
}

.link-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.link-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.link-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
}

.link-username {
    font-weight: 600;
    color: var(--text);
    font-size: 1.1rem;
}

.link-domain {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.domain-youtube {
    background: rgba(255, 0, 0, 0.1);
    color: var(--youtube);
}

.domain-instagram {
    background: rgba(228, 64, 95, 0.1);
    color: var(--instagram);
}

.domain-twitter {
    background: rgba(29, 161, 242, 0.1);
    color: var(--twitter);
}

.domain-twitch {
    background: rgba(145, 70, 255, 0.1);
    color: var(--twitch);
}

.domain-tiktok {
    background: rgba(0, 0, 0, 0.1);
    color: var(--tiktok);
}

.domain-other {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.link-time {
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

.link-content {
    margin: 15px 0;
}

.link-url {
    display: block;
    color: var(--text);
    text-decoration: none;
    word-break: break-all;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.95rem;
    padding: 12px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    margin: 10px 0;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.link-url:hover {
    color: var(--primary-light);
    background: rgba(145, 70, 255, 0.1);
    border-color: var(--primary);
}

.link-preview {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    padding: 10px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    border-left: 3px solid var(--border);
}

.link-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: flex-end;
}

.btn-link-action {
    padding: 8px 15px;
    font-size: 0.85rem;
    gap: 8px;
}

.btn-link-action.delete {
    color: var(--danger);
    background: rgba(255, 85, 85, 0.1);
    border: 1px solid rgba(255, 85, 85, 0.3);
}

.btn-link-action.delete:hover {
    background: rgba(255, 85, 85, 0.2);
}

/* Messages Container */
.messages-container {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 800px;
    overflow-y: auto;
    position: relative;
}

/* Slow mode dengan animasi yang benar */
.message-item {
    padding: 15px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: flex-start;
    gap: 15px;
    animation: fadeInUp 0.3s ease;
    opacity: 1;
    transform: translateY(0);
}

/* Ketika slow mode aktif, tambahkan animasi dengan delay */
.messages-container.slow-mode .message-item {
    animation: fadeInUp 1s ease;
}

/* Untuk mencegah scroll glitch, kita kontrol animasi dengan lebih baik */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.8rem;
    flex-shrink: 0;
}

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

.message-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.message-username {
    font-weight: 600;
    color: var(--text);
}

.message-time {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.message-text {
    color: var(--text-secondary);
    line-height: 1.5;
    word-break: break-word;
}

.message-text .url {
    color: var(--info);
    text-decoration: underline;
}

/* Users Container */
.users-container {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    max-height: 800px;
    overflow-y: auto;
}

.user-card {
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-sm);
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.user-card:hover {
    transform: translateY(-5px);
    background: rgba(0, 0, 0, 0.4);
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    margin: 0 auto 15px;
}

.user-name {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.user-stats {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.users-stats {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.users-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.users-stat {
    text-align: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 5px;
}

/* Statistics Tab */
.stats-container {
    padding: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.stat-card-large {
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-sm);
    padding: 20px;
}

.stat-card-large h4 {
    margin-bottom: 15px;
    color: var(--text);
    font-size: 1.1rem;
}

/* Charts */
.simple-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chart-bar {
    display: flex;
    align-items: center;
    gap: 15px;
}

.chart-bar-label {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 120px;
    color: var(--text);
    font-weight: 500;
}

.chart-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-icon.youtube { color: var(--youtube); }
.chart-icon.instagram { color: var(--instagram); }
.chart-icon.twitter { color: var(--twitter); }
.chart-icon.twitch { color: var(--twitch); }
.chart-icon.tiktok { color: var(--tiktok); }
.chart-icon.other { color: var(--text-secondary); }

.chart-bar-track {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.chart-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.chart-bar-fill.youtube { background: var(--youtube); }
.chart-bar-fill.instagram { background: var(--instagram); }
.chart-bar-fill.twitter { background: var(--twitter); }
.chart-bar-fill.twitch { background: var(--twitch); }
.chart-bar-fill.tiktok { background: var(--tiktok); }
.chart-bar-fill.other { background: var(--text-secondary); }

.chart-bar-value {
    min-width: 80px;
    text-align: right;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Top users list */
.top-users-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.top-user-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    transition: transform 0.2s ease;
}

.top-user-item:hover {
    transform: translateX(5px);
    background: rgba(0, 0, 0, 0.3);
}

.top-user-rank {
    width: 30px;
    height: 30px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
}

.top-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
}

.top-user-info {
    flex: 1;
}

.top-user-name {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.top-user-stats {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    gap: 8px;
}

/* Storage details */
.storage-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.storage-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.storage-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.storage-value {
    color: var(--text);
    font-weight: 500;
}

/* Toggle switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    margin-right: 10px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--success);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Data summary */
.data-summary {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.summary-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.summary-value {
    color: var(--text);
    font-weight: 600;
    font-family: 'Monaco', 'Courier New', monospace;
}

/* Notification Tab Styles */
.notification-settings {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.setting-card {
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.setting-header {
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border);
}

.setting-header h4 {
    color: var(--text);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.setting-content {
    padding: 20px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-light);
}

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

.setting-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.setting-info i {
    font-size: 1.2rem;
    color: var(--primary);
    width: 24px;
    text-align: center;
}

.setting-label {
    display: block;
    color: var(--text);
    font-weight: 500;
    margin-bottom: 4px;
}

.setting-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Notification container di tab */
#tab-notifications .notification-container {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification-item {
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary);
    animation: slideInRight 0.3s ease;
    font-size: 0.9rem;
}

.notification-item.success {
    border-left-color: var(--success);
}

.notification-item.error {
    border-left-color: var(--danger);
}

.notification-item.warning {
    border-left-color: var(--warning);
}

.notification-item.info {
    border-left-color: var(--info);
}

.notification-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 5px;
    display: block;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: 15px 20px;
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow);
    animation: slideInRight 0.3s ease;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.warning {
    border-left-color: var(--warning);
}

.toast.info {
    border-left-color: var(--info);
}

.toast.fact {
    border-left-color: #9c27b0;
}

.toast.fact i {
    color: #9c27b0;
}

.toast i {
    font-size: 1.2rem;
    margin-top: 2px;
}

.toast.success i {
    color: var(--success);
}

.toast.error i {
    color: var(--danger);
}

.toast.warning i {
    color: var(--warning);
}

.toast.info i {
    color: var(--info);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 5px;
}

.toast-message {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    line-height: 1;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--text);
}

.empty-state .hint {
    font-size: 0.9rem;
    color: var(--text-tertiary);
    margin-top: 10px;
}

/* Empty state actions */
.empty-state-actions {
    margin-top: 20px;
}

/* No data message */
.no-data {
    text-align: center;
    color: var(--text-tertiary);
    font-style: italic;
    padding: 40px;
}

/* Footer */
footer {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.app-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.app-info i {
    font-size: 2.5rem;
    color: var(--primary);
}

.tech-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.tech-info p {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding: 20px;
    color: var(--text-tertiary);
    font-size: 0.9rem;
    border-top: 1px solid var(--border);
}

/* Status indicator in footer */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin: 0 5px;
}

.status-indicator.active {
    background: var(--success);
    animation: pulse 2s infinite;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius);
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    border: 1px solid var(--border);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
}

.modal-header h2 {
    font-size: 1.5rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
    max-height: calc(80vh - 80px);
}

.help-section {
    margin-bottom: 25px;
}

.help-section:last-child {
    margin-bottom: 0;
}

.help-section h3 {
    margin-bottom: 10px;
    color: var(--text);
    font-size: 1.2rem;
}

.help-section ol, .help-section ul {
    padding-left: 20px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.help-section li {
    margin-bottom: 8px;
}

.help-section kbd {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    border: 1px solid var(--border);
}

/* Filter demo in help */
.icon-demo {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.filter-demo {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.filter-demo.youtube {
    background: rgba(255, 0, 0, 0.1);
    color: var(--youtube);
}

.filter-demo.twitter {
    background: rgba(29, 161, 242, 0.1);
    color: var(--twitter);
}

.filter-demo.instagram {
    background: rgba(228, 64, 95, 0.1);
    color: var(--instagram);
}

.filter-demo.tiktok {
    background: rgba(0, 0, 0, 0.1);
    color: var(--tiktok);
}

.filter-demo.twitch {
    background: rgba(145, 70, 255, 0.1);
    color: var(--twitch);
}

.filter-demo.other {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

/* Icon wrapper for fallback */
.icon-wrapper {
    position: relative;
    display: inline-block;
    width: 20px;
    height: 20px;
}

.icon-wrapper .icon-fallback {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Button success variant */
.btn-success {
    background: rgba(0, 255, 127, 0.1);
    color: var(--success);
    border: 2px solid var(--success);
}

.btn-success:hover {
    background: rgba(0, 255, 127, 0.2);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Responsive Design */
@media (max-width: 1200px) {
    main {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .filter-checkboxes {
        grid-template-columns: 1fr;
    }
    
    .quick-stats {
        grid-template-columns: 1fr;
    }
    
    .users-summary {
        grid-template-columns: 1fr;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .tab-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
    }
    
    .data-buttons {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .chart-bar-label {
        min-width: auto;
    }
    
    .chart-bar-value {
        text-align: left;
    }
    
    .clicked-filter-inline {
        flex-direction: column;
        width: 100%;
    }
    
    .clicked-filter-inline .filter-option {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 5px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .channel-input {
        flex-direction: column;
        gap: 10px;
    }
    
    .input-with-icon {
        width: 100%;
    }
    
    .tab-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .tab-actions {
        width: 100%;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .link-actions {
        flex-wrap: wrap;
    }
    
    .btn-link-action {
        flex: 1;
        min-width: 80px;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .app-info {
        flex-direction: column;
        text-align: center;
    }
    
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .setting-item .switch {
        align-self: flex-end;
    }
}