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

:root {
    --bg-0: #050812;
    --bg-1: #0a1023;
    --surface-0: rgba(12, 18, 32, 0.75);
    --surface-1: rgba(15, 23, 42, 0.92);
    --surface-solid: #0f172a;
    --border: rgba(148, 163, 184, 0.18);
    --text: #e5e7eb;
    --muted: rgba(226, 232, 240, 0.68);
    --accent-0: #94a3b8; /* нейтральный акцент (светло-серый) */
    --accent-1: #cbd5e1;
    --accent-soft: rgba(148, 163, 184, 0.15);
    --available-green: #22c55e;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        linear-gradient(180deg, rgba(5, 8, 18, 0.75) 0%, rgba(5, 8, 18, 0.82) 50%, rgba(5, 8, 18, 0.88) 100%),
        url('/static/images/example.jpg') no-repeat center center fixed;
    background-size: cover;
}

main {
    flex: 1 0 auto;
}

.text-muted {
    color: var(--muted) !important;
}

a {
    color: var(--accent-0);
}

a:hover {
    color: var(--accent-1);
}

/* Навигация */
.navbar {
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    background: rgba(7, 10, 18, 0.65) !important;
}

.navbar-brand {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    color: var(--accent-1) !important;
}

.navbar-brand,
.navbar .nav-link {
    color: var(--text) !important;
}

.nav-link {
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 1rem !important;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: var(--accent-1) !important;
    transform: translateY(-2px);
}

/* Быстрая навигация по категориям */
.category-tabs-wrapper {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(7, 10, 18, 0.55);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    border-radius: 15px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
    margin-bottom: 2rem;
}

.category-tabs {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    padding: 0 1rem;
}

.category-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.75);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    color: var(--text);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.category-tab:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 45px rgba(0, 0, 0, 0.55);
    border-color: rgba(148, 163, 184, 0.45);
}

.category-tab.active {
    background: rgba(148, 163, 184, 0.35);
    color: var(--text);
    border-color: rgba(148, 163, 184, 0.5);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.category-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.category-name {
    font-size: 1rem;
}

/* Карточки товаров */
.product-card {
    border: none;
    border-radius: 15px;
    transition: all 0.3s ease;
    background: var(--surface-1);
    border: 1px solid var(--border);
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65) !important;
    border-color: rgba(148, 163, 184, 0.35);
}

.product-item {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.product-item.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.card-title {
    color: var(--text);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.product-info {
    background: rgba(5, 8, 18, 0.55);
    padding: 1rem;
    border-radius: 10px;
    margin-top: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.12);
}

/* Значения State и Card Balance — светлее для читаемости */
.product-info .d-flex .fw-semibold {
    color: #f1f5f9;
}

.price {
    color: var(--accent-1);
}

.btn-primary {
    background: rgba(148, 163, 184, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.5);
    color: var(--text);
    border-radius: 8px;
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    background: rgba(148, 163, 184, 0.55);
    border-color: rgba(148, 163, 184, 0.65);
    color: var(--text);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}

/* Админка */
.card {
    border: none;
    border-radius: 15px;
    overflow: hidden;
    background: var(--surface-1);
    border: 1px solid var(--border);
}

.card-header {
    border: none;
    padding: 1.25rem 1.5rem;
    font-weight: 600;
}

.card-body {
    background: transparent;
}

.table {
    margin-bottom: 0;
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(15, 23, 42, 0.4);
    --bs-table-hover-bg: rgba(148, 163, 184, 0.08);
    --bs-table-border-color: var(--border);
}

.table,
.table thead,
.table tbody,
.table tr,
.table td,
.table th {
    color: var(--text) !important;
    background-color: transparent !important;
    border-color: var(--border) !important;
}

.table th {
    border-top: none;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table td {
    vertical-align: middle;
    padding: 1rem 0.75rem;
}

.table-hover tbody tr:hover {
    background: rgba(148, 163, 184, 0.08) !important;
}

.badge {
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.85rem;
}

.btn-sm {
    padding: 0.375rem 1rem;
    border-radius: 6px;
    font-weight: 500;
}

.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid var(--border);
    padding: 0.625rem 1rem;
    transition: all 0.3s ease;
    background: rgba(5, 8, 18, 0.35);
    color: var(--text);
}

.form-control:focus, .form-select:focus {
    border-color: rgba(148, 163, 184, 0.5);
    box-shadow: 0 0 0 0.2rem rgba(148, 163, 184, 0.15);
    background: rgba(5, 8, 18, 0.45);
    color: var(--text);
}

.form-label {
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.nav-tabs {
    border: none;
    gap: 0.5rem;
}

.nav-tabs .nav-link {
    border: none;
    border-radius: 10px 10px 0 0;
    padding: 1rem 2rem;
    font-weight: 600;
    color: var(--muted);
    background: rgba(15, 23, 42, 0.55);
    transition: all 0.3s ease;
}

.nav-tabs .nav-link.active {
    background: rgba(15, 23, 42, 0.88);
    color: var(--accent-1);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.45);
    border: 1px solid var(--border);
}

.nav-tabs .nav-link:hover {
    background: rgba(15, 23, 42, 0.88);
    color: var(--accent-1);
}

/* Футер */
footer {
    background: linear-gradient(135deg, rgba(2, 6, 23, 0.95) 0%, rgba(15, 23, 42, 0.95) 100%);
    margin-top: auto;
    border-top: 1px solid var(--border);
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .category-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        scrollbar-width: thin;
        padding-bottom: 0.5rem;
    }
    
    .category-tab {
        flex-shrink: 0;
        padding: 0.5rem 1rem;
    }
    
    .category-icon {
        font-size: 1.25rem;
    }
    
    .category-name {
        font-size: 0.9rem;
    }
}

/* Плейсхолдеры */
.placeholder-content {
    background: var(--surface-1);
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65);
}

/* Модальные окна */
.modal-content {
    border: none;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid var(--border);
    color: var(--text);
}

.modal-header {
    border-bottom: 1px solid var(--border);
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem;
}

/* Цвета для badge и других элементов */
.badge.bg-primary {
    background: rgba(148, 163, 184, 0.35) !important;
    color: var(--text) !important;
    border: 1px solid rgba(148, 163, 184, 0.4);
}

.text-primary {
    color: var(--accent-1) !important;
}

.btn-outline-primary {
    border-color: rgba(148, 163, 184, 0.5) !important;
    color: var(--accent-1) !important;
}

.btn-outline-primary:hover {
    background: rgba(148, 163, 184, 0.15) !important;
    border-color: rgba(148, 163, 184, 0.6) !important;
    color: var(--text) !important;
}

.bg-light {
    background: rgba(15, 23, 42, 0.65) !important;
}

.bg-primary {
    background: rgba(148, 163, 184, 0.2) !important;
    color: var(--text) !important;
}

.bg-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.28) 0%, rgba(5, 150, 105, 0.18) 100%) !important;
}

/* Заголовки карточек в админке — светлый текст */
.card-header.bg-primary .mb-0,
.card-header.bg-success .mb-0,
.card-header.bg-light .mb-0 {
    color: var(--text) !important;
}

.bg-dark {
    background: rgba(2, 6, 23, 0.95) !important;
}

.btn-secondary {
    background: rgba(148, 163, 184, 0.18) !important;
    border: 1px solid rgba(148, 163, 184, 0.25) !important;
    color: var(--text) !important;
}

.btn-secondary:hover {
    background: rgba(148, 163, 184, 0.24) !important;
}

.btn-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.95) 0%, rgba(5, 150, 105, 0.95) 100%) !important;
    border: none !important;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.14);
}

.btn-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.95) 0%, rgba(217, 119, 6, 0.95) 100%) !important;
    border: none !important;
}

.btn-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.95) 0%, rgba(220, 38, 38, 0.95) 100%) !important;
    border: none !important;
}

.btn-close {
    filter: invert(1) grayscale(1);
}

/* Границы/разделители Bootstrap */
.border-top {
    border-top-color: rgba(148, 163, 184, 0.16) !important;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.55);
}

::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.45);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.6);
}
