* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    width: 100%;
    max-width: 800px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

h1 {
    color: #333;
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
}

.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
    font-size: 15px;
}

input, select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input:focus, select:focus {
    border-color: #667eea;
    outline: none;
}

/* Сетка аббревиатур */
.abbr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.abbr-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.abbr-header {
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
    font-size: 16px;
    text-align: center;
}

.abbr-inputs {
    display: flex;
    gap: 10px;
}

.abbr-inputs input {
    flex: 1;
    padding: 8px;
    text-align: center;
}

/* Кнопки */
.buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

button {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-submit {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-clear {
    background: #f8f9fa;
    color: #666;
    border: 2px solid #e0e0e0;
}

.btn-clear:hover {
    background: #e9ecef;
}

/* Сообщение об успехе */
.success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    margin-top: 20px;
    font-weight: 600;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* JSON просмотрщик */
.json-viewer {
    margin-top: 40px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.btn-toggle {
    background: #6c757d;
    color: white;
    margin-bottom: 15px;
}

.btn-toggle:hover {
    background: #5a6268;
}

#jsonOutput {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.counter {
    text-align: center;
    font-weight: 600;
    color: #333;
    padding: 10px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    .abbr-grid {
        grid-template-columns: 1fr;
    }
    
    .buttons {
        flex-direction: column;
    }
    
    h1 {
        font-size: 24px;
    }
    
    button {
        padding: 12px;
    }
}
