/* ============ CSS Variables ============ */
:root {
    --bg-dark: #0a0a0f;
    --bg-card: #12121a;
    --bg-sidebar: #0d0d14;
    --bg-hover: #1a1a25;
    --bg-input: #15151f;
    
    --text-primary: #f0f0f5;
    --text-secondary: #8888a0;
    --text-muted: #555565;
    
    --accent-primary: #00ff88;
    --accent-danger: #ff4466;
    --accent-warning: #ffaa00;
    --accent-info: #00aaff;
    --accent-purple: #aa66ff;
    
    --border-color: #222235;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Space Mono', monospace;
}

/* ============ Reset & Base ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ============ Layout ============ */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ============ Sidebar ============ */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-info));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--bg-dark);
    font-family: var(--font-mono);
}

.logo-text {
    font-weight: 600;
    font-size: 18px;
    letter-spacing: -0.5px;
}

.nav-menu {
    list-style: none;
    padding: 16px 12px;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
    margin-bottom: 4px;
    font-weight: 500;
}

.nav-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.15), rgba(0, 170, 255, 0.1));
    color: var(--accent-primary);
    border: 1px solid rgba(0, 255, 136, 0.2);
}

.nav-icon {
    width: 20px;
    height: 20px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============ Main Content ============ */
.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    background: 
        radial-gradient(ellipse at top right, rgba(0, 255, 136, 0.03), transparent 50%),
        radial-gradient(ellipse at bottom left, rgba(0, 170, 255, 0.03), transparent 50%),
        var(--bg-dark);
}

.content-header {
    padding: 32px 40px;
    border-bottom: 1px solid var(--border-color);
}

.page-title {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.content-body {
    padding: 32px 40px;
}

/* ============ Stats Grid ============ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(0, 255, 136, 0.2);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 26px;
    height: 26px;
}

.stat-icon.banned {
    background: linear-gradient(135deg, rgba(255, 68, 102, 0.2), rgba(255, 68, 102, 0.1));
    color: var(--accent-danger);
}

.stat-icon.groups {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.2), rgba(0, 255, 136, 0.1));
    color: var(--accent-primary);
}

.stat-icon.total {
    background: linear-gradient(135deg, rgba(0, 170, 255, 0.2), rgba(0, 170, 255, 0.1));
    color: var(--accent-info);
}

.stat-icon.keywords {
    background: linear-gradient(135deg, rgba(170, 102, 255, 0.2), rgba(170, 102, 255, 0.1));
    color: var(--accent-purple);
}

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

.stat-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    font-family: var(--font-mono);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 6px;
}

/* ============ Info Section ============ */
.info-section {
    margin-bottom: 32px;
}

.info-section h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.step-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    position: relative;
}

.step-number {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-info));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--bg-dark);
    margin-bottom: 16px;
    font-family: var(--font-mono);
}

.step-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.step-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.webhook-info {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
}

.webhook-url {
    display: inline-block;
    background: var(--bg-input);
    padding: 12px 20px;
    border-radius: var(--border-radius-sm);
    font-family: var(--font-mono);
    font-size: 15px;
    color: var(--accent-primary);
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
}

.webhook-info p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ============ Section Header ============ */
.section-header {
    margin-bottom: 24px;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 15px;
}

/* ============ Forms ============ */
.add-form-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    margin-bottom: 24px;
}

.add-form {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.add-form.inline {
    flex-wrap: nowrap;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-sans);
    transition: all 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

/* ============ Buttons ============ */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), #00cc6e);
    color: var(--bg-dark);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 255, 136, 0.3);
}

.btn-danger {
    background: rgba(255, 68, 102, 0.15);
    color: var(--accent-danger);
    border: 1px solid rgba(255, 68, 102, 0.3);
}

.btn-danger:hover {
    background: rgba(255, 68, 102, 0.25);
}

.btn-warning {
    background: rgba(255, 170, 0, 0.15);
    color: var(--accent-warning);
    border: 1px solid rgba(255, 170, 0, 0.3);
}

.btn-warning:hover {
    background: rgba(255, 170, 0, 0.25);
}

.btn-success {
    background: rgba(0, 255, 136, 0.15);
    color: var(--accent-primary);
    border: 1px solid rgba(0, 255, 136, 0.3);
}

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

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}

.inline-form {
    display: inline;
}

/* ============ Tables ============ */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 16px 20px;
    background: var(--bg-sidebar);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover {
    background: var(--bg-hover);
}

.mono {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-secondary);
}

.reason-cell {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.actions-cell {
    display: flex;
    gap: 8px;
}

/* ============ Status Badge ============ */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.active {
    background: rgba(0, 255, 136, 0.15);
    color: var(--accent-primary);
}

.status-badge.inactive {
    background: rgba(255, 170, 0, 0.15);
    color: var(--accent-warning);
}

/* ============ Keywords Grid ============ */
.keywords-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.keyword-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 10px 12px 10px 18px;
    transition: all 0.2s ease;
}

.keyword-tag:hover {
    border-color: rgba(170, 102, 255, 0.4);
    background: var(--bg-hover);
}

.keyword-text {
    font-size: 14px;
    color: var(--text-primary);
}

.keyword-remove {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 68, 102, 0.15);
    color: var(--accent-danger);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.keyword-remove:hover {
    background: rgba(255, 68, 102, 0.3);
}

.keyword-remove svg {
    width: 14px;
    height: 14px;
}

/* ============ Empty State ============ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.empty-icon {
    width: 64px;
    height: 64px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ============ Help Section ============ */
.help-section {
    margin-top: 32px;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.help-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.help-section p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.help-section code {
    background: var(--bg-input);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--accent-info);
}

.help-section ul {
    margin-top: 12px;
    padding-left: 20px;
}

.help-section li {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
}

/* ============ Responsive ============ */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content-header,
    .content-body {
        padding: 20px;
    }
    
    .add-form {
        flex-direction: column;
    }
    
    .form-group {
        width: 100%;
    }
    
    .actions-cell {
        flex-direction: column;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 12px;
    }
}

