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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    position: fixed;
    height: 100vh;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.logo i {
    font-size: 28px;
}

.logo h2 {
    font-size: 22px;
}

nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
}

.nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.nav-link.active {
    background: rgba(255,255,255,0.2);
    color: white;
}

.nav-link i {
    font-size: 18px;
    width: 20px;
}

.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 30px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: white;
    padding: 20px 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

header h1 {
    color: #333;
    font-size: 28px;
}

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

.user-info i {
    font-size: 32px;
    color: #667eea;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

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

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
}

.stat-info h3 {
    font-size: 32px;
    color: #333;
    margin-bottom: 5px;
}

.stat-info p {
    color: #999;
    font-size: 14px;
}

.chart-container {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.chart-container h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 20px;
}

.activity-list {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    padding: 15px;
    border-left: 3px solid #667eea;
    background: #f8f9fa;
    margin-bottom: 10px;
    border-radius: 5px;
}

.activity-item.success {
    border-left-color: #4CAF50;
}

.activity-item.failed {
    border-left-color: #f44336;
}

.activity-item .time {
    color: #999;
    font-size: 12px;
}

.activity-item .url {
    color: #333;
    font-weight: 500;
    margin-top: 5px;
}

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

.card h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.card-header h2 {
    margin-bottom: 0;
}

textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: monospace;
    resize: vertical;
    transition: border-color 0.3s;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
}

button {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    transition: transform 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

button:hover {
    transform: translateY(-2px);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #f44336;
    padding: 8px 16px;
    font-size: 14px;
    margin-top: 0;
}

#progress {
    font-size: 16px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 15px;
    padding: 12px;
    background: #e7f3ff;
    border-radius: 8px;
}

#output {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.log-entry {
    padding: 10px 12px;
    margin: 8px 0;
    border-radius: 6px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.log-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.log-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.log-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

#summary {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #667eea;
}

#summary h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 18px;
}

#summary p {
    color: #555;
    font-size: 16px;
    margin: 8px 0;
    display: flex;
    justify-content: space-between;
}

#historyList {
    max-height: 600px;
    overflow-y: auto;
}

.history-item {
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.3s;
}

.history-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

.history-time {
    color: #999;
    font-size: 13px;
}

.history-stats {
    display: flex;
    gap: 15px;
    font-size: 14px;
}

.history-stats span {
    padding: 4px 10px;
    border-radius: 4px;
}

.history-stats .success {
    background: #d4edda;
    color: #155724;
}

.history-stats .failed {
    background: #f8d7da;
    color: #721c24;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.credit-banner {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    padding: 25px 30px;
    border-radius: 12px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(255, 165, 0, 0.3);
}

.credit-info {
    display: flex;
    align-items: center;
    gap: 20px;
    color: white;
}

.credit-info i {
    font-size: 48px;
}

.credit-info h3 {
    font-size: 36px;
    margin: 0;
    font-weight: 700;
}

.credit-info p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

.btn-refresh {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 20px;
    border: 2px solid white;
    margin: 0;
}

.btn-refresh:hover {
    background: white;
    color: #FFA500;
}

@media (max-width: 768px) {
    .sidebar {
        width: 70px;
        padding: 20px 10px;
    }
    
    .logo h2, .nav-link span {
        display: none;
    }
    
    .main-content {
        margin-left: 70px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
