* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
}

.form-container {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#codeInput {
    flex: 1;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    transition: border-color 0.3s;
}

#codeInput:focus {
    outline: none;
    border-color: #3498db;
}

#codeInput:invalid {
    border-color: #e74c3c;
}

#checkButton {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background-color: #3498db;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#checkButton:hover {
    background-color: #2980b9;
}

#checkButton:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.result {
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    font-weight: 500;
    transition: opacity 0.3s;
}

.result.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.result.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.result.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.hidden {
    display: none;
}

.stats-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.stats-container h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 20px;
}

.stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.stat-item {
    flex: 1;
    min-width: 150px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 6px;
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #3498db;
}

.stat-label {
    font-size: 14px;
    color: #7f8c8d;
}

.recent-checks {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.recent-checks h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 18px;
}

#recentList {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
}

#recentList li {
    padding: 8px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#recentList li:last-child {
    border-bottom: none;
}

.code-badge {
    background-color: #e9ecef;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: monospace;
}

.activation-count {
    color: #28a745;
    font-weight: 600;
}

.connection-status {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
}

.connection-status.connected {
    background-color: #28a745;
}

.connection-status.disconnected {
    background-color: #dc3545;
}

@media (max-width: 600px) {
    .input-group {
        flex-direction: column;
    }
    
    #checkButton {
        width: 100%;
    }
}
/* Добавляем в конец файла */

.top-codes {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-top: 30px;
}

.top-codes h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 18px;
}

.top-codes ul {
    list-style: none;
}

.top-codes li {
    padding: 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
}

.top-codes li:hover {
    background-color: #f8f9fa;
}

.top-codes li:last-child {
    border-bottom: none;
}

/* Анимация для новых элементов */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.recent-checks li {
    animation: slideIn 0.3s ease-out;
}

/* Улучшенные стили для мобильных устройств */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .form-container,
    .stats-container,
    .recent-checks,
    .top-codes {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    h1 {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    .stats {
        flex-direction: column;
    }
    
    .stat-item {
        margin-bottom: 10px;
    }
}

/* Темная тема (опционально) */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }
    
    .form-container,
    .stats-container,
    .recent-checks,
    .top-codes {
        background: #2d2d2d;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }
    
    h1, h2, h3 {
        color: #e0e0e0;
    }
    
    #codeInput {
        background-color: #3d3d3d;
        border-color: #4d4d4d;
        color: #e0e0e0;
    }
    
    #codeInput:focus {
        border-color: #5a9fd4;
    }
    
    .code-badge {
        background-color: #3d3d3d;
        color: #e0e0e0;
    }
    
    #recentList li,
    .top-codes li {
        border-bottom-color: #3d3d3d;
    }
    
    #recentList li:hover,
    .top-codes li:hover {
        background-color: #3d3d3d;
    }
}