/* style.css - Стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 28px;
}

/* Формы */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Кнопки */
.btn {
    display: inline-block;
    padding: 8px 16px;
    background: #ecf0f1;
    color: #333;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
    margin-right: 5px;
}

.btn:hover {
    background: #d5dbdb;
}

.btn-primary {
    background: #3498db;
    color: #fff;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-small {
    padding: 4px 10px;
    font-size: 12px;
}

/* Уведомления */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert.error {
    background: #fde8e8;
    color: #c0392b;
    border: 1px solid #f5c6cb;
}

.alert.success {
    background: #e8f5e9;
    color: #27ae60;
    border: 1px solid #c3e6cb;
}

/* Навигация */
.navigation {
    margin-bottom: 20px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Таблица (div-based) */
.table-wrapper {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.table-header,
.table-row {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
}

.table-header {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
}

.table-row:last-child {
    border-bottom: none;
}

.cell {
    padding: 12px 15px;
    display: flex;
    align-items: center;
}

.cell-id {
    flex: 0 0 60px;
}

.cell-title {
    flex: 1;
    min-width: 120px;
}

.cell-field1,
.cell-field2,
.cell-field3,
.cell-field4 {
    flex: 1;
    min-width: 100px;
}

.cell-actions {
    flex: 0 0 200px;
    justify-content: flex-end;
    gap: 5px;
}

.table-header .cell a {
    color: #555;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.table-header .cell a:hover {
    color: #3498db;
}

/* Пустое сообщение */
.empty-message {
    text-align: center;
    padding: 40px 20px;
    color: #888;
    font-size: 16px;
}

.empty-message a {
    color: #3498db;
    text-decoration: none;
}

.empty-message a:hover {
    text-decoration: underline;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .table-header,
    .table-row {
        flex-wrap: wrap;
    }
    
    .cell {
        flex: 1 1 100% !important;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .cell:last-child {
        border-bottom: none;
    }
    
    .cell-actions {
        justify-content: flex-start;
        flex: 0 0 100%;
    }
    
    .table-header {
        display: none;
    }
    
    .table-row {
        border: 1px solid #e0e0e0;
        margin-bottom: 10px;
        border-radius: 4px;
    }
    
    .cell::before {
        content: attr(data-label);
        font-weight: 600;
        margin-right: 10px;
        color: #555;
    }
}

@media (min-width: 769px) {
    .cell-field1,
    .cell-field2,
    .cell-field3,
    .cell-field4 {
        flex: 1;
    }
}

/* Дополнительные стили для форм */
form {
    max-width: 600px;
    margin: 0 auto;
}

form .form-group:last-child {
    text-align: center;
    margin-top: 30px;
}

/* Ссылки в тексте */
p {
    margin-top: 15px;
    text-align: center;
}

p a {
    color: #3498db;
    text-decoration: none;
}

p a:hover {
    text-decoration: underline;
}

/* Стили для главной страницы */
.index-container {
    text-align: center;
    padding: 40px 20px;
}

.index-container .btn {
    margin: 10px;
    padding: 12px 30px;
    font-size: 16px;
}

.index-container .btn-primary {
    background: #2ecc71;
}

.index-container .btn-primary:hover {
    background: #27ae60;
}
