/* Complete CSS file */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Login Page */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    text-align: center;
}

.login-box h1 {
    color: #333;
    margin-bottom: 30px;
    font-size: 24px;
}

.login-form input {
    width: 100%;
    padding: 15px;
    margin-bottom: 20px;
    border: 2px solid #e1e5eb;
    border-radius: 8px;
    font-size: 16px;
}

.login-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.login-btn:hover {
    transform: translateY(-2px);
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid #c33;
}

/* Dashboard Styles */
.dashboard-container {
    padding: 20px;
    background: #f5f7fa;
    min-height: 100vh;
}

.dashboard-header {
    background: white;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.header-left h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 28px;
}

.header-left p {
    color: #666;
    font-size: 14px;
}

.header-right {
    display: flex;
    gap: 10px;
}

.btn-refresh, .logout-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-refresh {
    background: #e9ecef;
    color: #495057;
    border: 1px solid #dee2e6;
}

.logout-btn {
    background: #dc3545;
    color: white;
    border: none;
}

/* Stats Bar */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-box {
    background: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s;
}

.stat-box:hover {
    transform: translateY(-5px);
}

.stat-box i {
    font-size: 24px;
    margin-bottom: 10px;
    display: block;
}

.stat-number {
    font-size: 36px;
    font-weight: bold;
    display: block;
    color: #333;
}

.stat-label {
    color: #6c757d;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Clients Section */
.clients-section {
    background: white;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    color: #333;
    font-size: 22px;
}

.section-actions {
    display: flex;
    gap: 10px;
}

.btn-delete-all {
    background: #dc3545;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.client-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-btn {
    padding: 8px 16px;
    background: #e9ecef;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.filter-btn.active {
    background: #667eea;
    color: white;
}

/* Client List */
.client-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.client-card {
    border: 1px solid #e9ecef;
    padding: 20px;
    border-radius: 12px;
    background: #f8f9fa;
    transition: all 0.3s;
}

.client-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.client-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.client-id-info .client-id {
    font-weight: bold;
    color: #2c3e50;
    font-size: 18px;
    margin-bottom: 5px;
}

.client-time {
    color: #6c757d;
    font-size: 12px;
}

.client-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.client-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.status-waiting {
    background: #fff3cd;
    color: #856404;
}

.status-redirected {
    background: #d4edda;
    color: #155724;
}

.btn-delete-client {
    background: #f8d7da;
    color: #721c24;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Client Info */
.client-info {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 20px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #495057;
    font-size: 14px;
}

/* Timer Section */
.client-timer-section {
    background: #e9ecef;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.timer-label {
    color: #495057;
    margin-bottom: 10px;
    font-size: 14px;
}

.timer-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.timer-countdown {
    font-size: 32px;
    font-weight: bold;
    font-family: monospace;
    color: #28a745;
}

.timer-countdown.warning {
    color: #ffc107;
}

.timer-countdown.critical {
    color: #dc3545;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.timer-text {
    color: #6c757d;
    font-size: 14px;
}

/* Redirect Section */
.redirect-section {
    margin-bottom: 20px;
}

.section-title {
    color: #495057;
    margin-bottom: 15px;
    font-size: 14px;
}

.redirect-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.redirect-btn {
    padding: 10px;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.redirect-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    opacity: 0.9;
}

.redirect-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.red { background: #dc3545; }
.green { background: #28a745; }
.blue { background: #007bff; }
.orange { background: #fd7e14; }
.purple { background: #6f42c1; }

/* Current Redirect */
.current-redirect {
    background: #d4edda;
    color: #155724;
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
    border-left: 4px solid #28a745;
}

.auto-redirect-notice {
    background: #d1ecf1;
    color: #0c5460;
    padding: 10px;
    border-radius: 6px;
    margin-top: 10px;
    font-size: 13px;
    border-left: 3px solid #17a2b8;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #495057;
}

/* Instructions */
.instructions-box {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.instructions-box h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 18px;
}

.instructions-box ol {
    margin-left: 20px;
    color: #495057;
    line-height: 1.8;
}

.instructions-box li {
    margin-bottom: 10px;
}

/* Client Page Styles */
.client-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.waiting-box {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.client-id-box {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    border: 2px dashed #dee2e6;
}

.client-id {
    font-family: monospace;
    font-size: 18px;
    color: #2c3e50;
    font-weight: bold;
}

.timer-box {
    font-size: 18px;
    margin: 20px 0;
    padding: 15px;
    background: #fff3cd;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
}

.countdown {
    color: #e74c3c;
    font-weight: bold;
    font-size: 20px;
    font-family: monospace;
}

.status-message {
    padding: 15px;
    margin: 20px 0;
    border-radius: 8px;
    background: #e9ecef;
    color: #495057;
}

.status-message.redirecting {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.status-message.timeout {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.redirect-notice {
    background: #cce5ff;
    color: #004085;
    padding: 12px;
    border-radius: 6px;
    margin: 20px 0;
    border-left: 4px solid #007bff;
}

.notice {
    background: #d1ecf1;
    color: #0c5460;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    margin-top: 20px;
}

/* Icons */
.icon-clock:before { content: "🕒 "; }
.icon-info:before { content: "ℹ️ "; }
.icon-redirect:before { content: "↪️ "; }
.icon-waiting:before { content: "⏳ "; }
.icon-timeout:before { content: "⏰ "; }
.icon-dashboard:before { content: "📊 "; }
.icon-users:before { content: "👥 "; }
.icon-time:before { content: "⏱️ "; }
.icon-ip:before { content: "🌐 "; }
.icon-lock:before { content: "🔒 "; }
.icon-refresh:before { content: "🔄 "; }
.icon-logout:before { content: "🚪 "; }
.icon-total:before { content: "📈 "; }
.icon-waiting:before { content: "⏳ "; }
.icon-redirected:before { content: "✅ "; }
.icon-delete:before { content: "🗑️ "; }
.icon-check:before { content: "✓ "; }
.icon-auto:before { content: "🤖 "; }
.icon-empty:before { content: "📭 "; }

/* Responsive */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .header-right {
        width: 100%;
        justify-content: flex-end;
    }
    
    .client-list {
        grid-template-columns: 1fr;
    }
    
    .redirect-buttons {
        grid-template-columns: 1fr;
    }
    
    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }
}