/* Основные стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

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

/* Заголовки */
h1, h2, h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

h1 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

h2 {
    font-size: 1.8rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.3rem;
    color: #34495e;
}

/* Кнопки */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #95a5a6;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    margin: 5px;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #7f8c8d;
}

.btn-primary {
    background-color: #3498db;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #2ecc71;
}

.btn-secondary:hover {
    background-color: #27ae60;
}

.btn-danger {
    background-color: #e74c3c;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-copy {
    padding: 5px 10px;
    font-size: 12px;
    background-color: #9b59b6;
}

.btn-copy:hover {
    background-color: #8e44ad;
}

/* Статусы */
.status {
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
    text-align: center;
}

.status.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.status-badge {
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

.status-badge.active {
    background-color: #d4edda;
    color: #155724;
}

.status-badge.inactive {
    background-color: #f8d7da;
    color: #721c24;
}

/* Информационные блоки */
.info-box {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.info-box ul {
    margin-left: 20px;
}

.info-box li {
    margin-bottom: 8px;
}

.required-fields {
    margin-top: 15px;
}

.field-chunk {
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.field-tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-family: monospace;
    border: 1px solid #bbdefb;
}

/* Управление */
.controls {
    text-align: center;
    margin: 30px 0;
}

.admin-actions {
    text-align: center;
    margin: 30px 0;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

/* Карточки источников */
.sources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.source-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 4px solid #3498db;
}

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

.source-header h3 {
    margin: 0;
    flex: 1;
}

.source-id {
    background: #ecf0f1;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    color: #7f8c8d;
}

.source-description {
    color: #666;
    font-style: italic;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ecf0f1;
}

.source-info {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.source-info div {
    margin-bottom: 5px;
}

.source-actions {
    margin: 15px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.source-link {
    margin: 15px 0;
}

.source-link label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 14px;
}

.link-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.link-container code {
    flex: 1;
    background: #f8f9fa;
    padding: 8px;
    border-radius: 3px;
    font-size: 12px;
    word-break: break-all;
}

/* Формы */
.admin-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.source-form {
    max-width: 600px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #2c3e50;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group input[type="checkbox"] {
    margin-right: 8px;
}

.form-help {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

/* Списки */
.sources-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Детали редактирования */
.edit-form {
    margin-top: 15px;
    border-top: 1px solid #ecf0f1;
    padding-top: 15px;
}

.edit-form summary {
    cursor: pointer;
    font-weight: bold;
    color: #3498db;
    margin-bottom: 10px;
}

/* Состояние пустого списка */
.empty-state {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.empty-state p {
    margin-bottom: 20px;
    color: #666;
    font-size: 18px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .sources-grid {
        grid-template-columns: 1fr;
    }
    
    .source-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .source-id {
        margin-top: 5px;
    }
    
    .link-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .source-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        margin: 2px 0;
    }
    
    .field-chunk {
        flex-direction: column;
        align-items: flex-start;
    }
}