* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    transition: background 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 3px solid #667eea;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 28px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.user-info span {
    font-weight: 600;
    color: #667eea;
}

.screen {
    display: none;
}

#login-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.auth-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.auth-container h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #667eea;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.tab {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #999;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.auth-form input {
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.auth-form input:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn-success {
    background: #48bb78;
    color: white;
}

.btn-success:hover {
    background: #38a169;
}

.btn-warning {
    background: #ed8936;
    color: white;
}

.btn-warning:hover {
    background: #dd6b20;
}

.btn-danger {
    background: #f56565;
    color: white;
}

.btn-danger:hover {
    background: #e53e3e;
}

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

.error-message {
    padding: 12px;
    background: #fed7d7;
    color: #c53030;
    border-radius: 8px;
    margin-bottom: 15px;
    display: none;
}

.error-message.show {
    display: block;
}

.card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.card h2 {
    margin-bottom: 20px;
    color: #667eea;
}

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

.stat-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-card h3 {
    font-size: 14px;
    color: #999;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: #667eea;
}

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

.bot-form input,
.bot-form select {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
}

.bot-form input:focus,
.bot-form select:focus {
    outline: none;
    border-color: #667eea;
}

.bot-item {
    background: #f7fafc;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.bot-item:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.bot-item.running {
    border-color: #48bb78;
    background: #f0fff4;
}

.bot-info h3 {
    margin-bottom: 8px;
    color: #333;
}

.bot-info p {
    color: #666;
    font-size: 14px;
    margin-bottom: 5px;
}

.bot-status {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
}

.bot-status.running {
    background: #c6f6d5;
    color: #22543d;
}

.bot-status.stopped {
    background: #e2e8f0;
    color: #4a5568;
}

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

.bot-actions .btn {
    padding: 8px 16px;
    font-size: 14px;
}

.session-item {
    background: #f7fafc;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
}

.session-item h4 {
    margin-bottom: 8px;
    color: #333;
}

.session-item p {
    color: #666;
    font-size: 14px;
    margin-bottom: 3px;
}

.empty-state {
    text-align: center;
    color: #999;
    padding: 40px;
    font-size: 16px;
}

/* Dark Mode - Enhanced */
body.dark-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%) !important;
    color: #e0e0e0 !important;
}

body.dark-mode .card,
body.dark-mode .stat-card,
body.dark-mode .auth-container {
    background: #2a2a3e !important;
    color: #e0e0e0 !important;
    border-color: #4a4a6e !important;
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3 {
    color: #9fa8da !important;
}

body.dark-mode h4,
body.dark-mode p,
body.dark-mode span {
    color: #e0e0e0 !important;
}

body.dark-mode header {
    background: rgba(42, 42, 62, 0.95) !important;
    border-bottom-color: #667eea !important;
}

body.dark-mode .auth-form input,
body.dark-mode .bot-form input,
body.dark-mode .bot-form select {
    background: #1a1a2e !important;
    color: #e0e0e0 !important;
    border-color: #667eea !important;
}

body.dark-mode .bot-item {
    background: #1e1e3e !important;
    border-color: #4a4a6e !important;
}

body.dark-mode .bot-item.running {
    border-color: #48bb78 !important;
    background: #1a3a2e !important;
}

body.dark-mode .bot-info h3 {
    color: #9fa8da !important;
}

body.dark-mode .bot-info p {
    color: #b0b0c0 !important;
}

body.dark-mode .session-item {
    background: #1e1e3e !important;
    border-color: #4a4a6e !important;
}

body.dark-mode .session-item h4 {
    color: #9fa8da !important;
}

body.dark-mode .session-item p {
    color: #b0b0c0 !important;
}

body.dark-mode .stat-value {
    color: #9fa8da !important;
}

body.dark-mode .stat-card h3 {
    color: #b0b0c0 !important;
}

body.dark-mode .user-info span {
    color: #9fa8da !important;
}

body.dark-mode .empty-state {
    color: #b0b0c0 !important;
}

body.dark-mode .tabs {
    border-bottom-color: #4a4a6e;
}

body.dark-mode .tab {
    color: #888;
}

body.dark-mode .tab.active {
    color: #9fa8da;
    border-bottom-color: #667eea;
}

body.dark-mode .admin-table th,
body.dark-mode .admin-table td {
    border-bottom-color: #4a4a6e;
    color: #e0e0e0;
}

body.dark-mode .admin-table th {
    background: #1a1a2e;
    color: #9fa8da;
}

body.dark-mode .admin-table tr:hover {
    background: #1e1e3e;
}

.dark-mode-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

/* Logs Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 20px;
    border-radius: 15px;
    width: 80%;
    max-width: 900px;
    max-height: 80vh;
    overflow-y: auto;
}

body.dark-mode .modal-content {
    background: #2a2a3e;
    color: #e0e0e0;
}

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

.close-modal {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
}

.close-modal:hover {
    color: #333;
}

body.dark-mode .close-modal:hover {
    color: #fff;
}

.logs-container {
    background: #1a1a1a;
    color: #0f0;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    white-space: pre-wrap;
    max-height: 500px;
    overflow-y: auto;
    line-height: 1.5;
}

/* Charts */
.chart-container {
    position: relative;
    height: 300px;
    margin: 20px 0;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 10px;
}

.status-badge.online {
    background: #48bb78;
    color: white;
}

.status-badge.offline {
    background: #cbd5e0;
    color: #4a5568;
}

/* Admin Panel */
.admin-table {
    overflow-x: auto;
}

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

.admin-table th,
.admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

body.dark-mode .admin-table th,
body.dark-mode .admin-table td {
    border-bottom-color: #3a3a4e;
}

.admin-table th {
    background: #f7fafc;
    font-weight: 600;
}

body.dark-mode .admin-table th {
    background: #1a1a2e;
}

.admin-table tr:hover {
    background: #f7fafc;
}

body.dark-mode .admin-table tr:hover {
    background: #1a1a2e;
}

.user-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.user-badge.admin {
    background: #667eea;
    color: white;
}

.user-badge.active {
    background: #48bb78;
    color: white;
}

.user-badge.inactive {
    background: #f56565;
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .bot-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .bot-actions {
        margin-top: 15px;
        width: 100%;
        flex-wrap: wrap;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .admin-table {
        font-size: 12px;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 8px;
    }
}

/* Animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification {
    animation: slideIn 0.3s ease;
}
