/* ============================================
   ОСНОВНЫЕ СТИЛИ АДМИН-ПАНЕЛИ
   Соответствуют стилю главной страницы
============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f8fafc;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ============================================
   Авторизация
============================================ */
.login-page {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ============================================
   ШАПКА АДМИНКИ (стилизуем как на главной)
============================================ */
.admin-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 15px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.admin-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.admin-logo {
    font-size: 22px;
    font-weight: bold;
    color: #4cc9f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-logo:before {
    content: "💠";
    font-size: 24px;
}

.admin-nav ul {
    display: flex;
    list-style: none;
    gap: 20px;
    flex-wrap: wrap;
}

.admin-nav a {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 4px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.admin-nav a:hover {
    background: rgba(255,255,255,0.1);
    color: #4cc9f0;
}

.admin-nav .active {
    background: rgba(76, 201, 240, 0.2);
    color: #4cc9f0;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255,255,255,0.1);
    padding: 8px 15px;
    border-radius: 20px;
}

.btn-logout {
    background: #dc3545;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: #c82333;
}

/* ============================================
   ОСНОВНОЙ КОНТЕНТ
============================================ */
.admin-panel {
    min-height: calc(100vh - 150px);
    padding-bottom: 50px;
}

.admin-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
}

.admin-section h2 {
    color: #1a1a2e;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #4cc9f0;
    font-size: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-section h2:before {
    content: "📦";
    font-size: 20px;
}

/* ============================================
   ФОРМА ДОБАВЛЕНИЯ ТОВАРА
============================================ */
.product-form {
    max-width: 100%;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 15px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s;
    background: #f8f9fa;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #4cc9f0;
    background: white;
    box-shadow: 0 0 0 3px rgba(76, 201, 240, 0.2);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: #6c757d;
    font-size: 13px;
}

.btn-admin {
    background: linear-gradient(to right, #4cc9f0, #3aa8c9);
    color: white;
    padding: 14px 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(76, 201, 240, 0.3);
}

.btn-admin:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 201, 240, 0.4);
}

.btn-admin:before {
    content: "➕";
}

/* ============================================
   КАРТОЧКИ ТОВАРОВ В АДМИНКЕ
============================================ */
.products-grid-admin {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.product-card-admin {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.product-card-admin:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
}

.product-image-admin {
    height: 200px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.product-image-admin img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s;
    border-radius: 4px;
}

.product-image-admin:hover img {
    transform: scale(1.05);
}

.image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 14px;
    text-align: center;
    padding: 20px;
}

.image-placeholder svg {
    width: 60px;
    height: 60px;
    margin-bottom: 10px;
    opacity: 0.5;
}

.product-details-admin {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title-admin {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 8px;
    line-height: 1.4;
}

.product-category-admin {
    display: inline-block;
    background: #e9ecef;
    color: #495057;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 12px;
    align-self: flex-start;
}

.product-description-admin {
    color: #6c757d;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 15px;
    flex-grow: 1;
}

.product-price-admin {
    font-size: 22px;
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 15px;
}

.product-actions-admin {
    display: flex;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.btn-edit, .btn-delete {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-edit {
    background: #ffc107;
    color: #212529;
}

.btn-edit:hover {
    background: #e0a800;
}

.btn-delete {
    background: #dc3545;
    color: white;
}

.btn-delete:hover {
    background: #c82333;
}

/* ============================================
   СООБЩЕНИЯ (успех/ошибка)
============================================ */
.alert-message {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
}

.alert-success {
    background: #d4edda;
    border-left-color: #28a745;
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

.alert-message:before {
    font-size: 20px;
}

.alert-success:before {
    content: "✅";
}

.alert-error:before {
    content: "❌";
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   АДАПТИВНОСТЬ
============================================ */
@media (max-width: 992px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .products-grid-admin {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .admin-header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .admin-nav ul {
        justify-content: center;
    }
    
    .products-grid-admin {
        grid-template-columns: 1fr;
    }
    
    .product-actions-admin {
        flex-direction: column;
    }
    
    .admin-section {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        width: 95%;
        padding: 0 10px;
    }
    
    .admin-section {
        padding: 15px;
    }
    
    .btn-admin {
        width: 100%;
        justify-content: center;
    }
}