/* ============================================
   Wish+ Modern CSS - Полностью переработанный дизайн
   ============================================ */

/* ---------- Базовые переменные ---------- */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #ec4899;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --dark: #1e293b;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    color: var(--gray-800);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------- Навбар ---------- */
.navbar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    padding: 0.75rem 0;
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.6rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
    transition: transform 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.navbar-brand i {
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    color: var(--primary);
}

.nav-link {
    font-weight: 500;
    color: var(--gray-600) !important;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--primary) !important;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 80%;
}

.btn-outline-primary {
    border-color: var(--primary);
    color: var(--primary);
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
}

/* ---------- Главный контент - растягивается на всю высоту ---------- */
main {
    flex: 1 0 auto;
}

.page-container {
    min-height: 500px;
    padding: 2rem 0;
}

/* ---------- Hero секция ---------- */
.hero-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--primary-dark) 100%);
    color: white;
    border-radius: var(--radius-xl);
    padding: 4rem 2rem;
    margin-bottom: 3rem;
    text-align: center;
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
}

.hero-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><path fill="rgba(255,255,255,0.05)" d="M100 0L200 200H0L100 0z"/></svg>');
    background-size: 60px 60px;
    opacity: 0.1;
}

.hero-gradient h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.hero-gradient .lead {
    font-size: 1.25rem;
    opacity: 0.95;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

/* ---------- Карточки ---------- */
.card {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    background: white;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    background: white;
    border-bottom: 2px solid var(--gray-100);
    padding: 1.25rem 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* Карточки товаров */
.product-card {
    cursor: pointer;
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
    box-shadow: var(--shadow-sm);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover img {
    transform: scale(1.05);
}

.product-card .card-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--gray-800);
}

.price-tag {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
}

/* ---------- Формы ---------- */
.form-control, .form-select {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    outline: none;
}

.form-label {
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

/* ---------- Кнопки ---------- */
.btn {
    border-radius: var(--radius-md);
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    border: none;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, #dc2626 0%, var(--danger) 100%);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    border: none;
}

.btn-outline-secondary {
    border: 2px solid var(--gray-300);
    color: var(--gray-600);
}

.btn-outline-secondary:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
    transform: translateY(-2px);
}

/* ---------- Бейджи ---------- */
.badge {
    padding: 0.375rem 0.75rem;
    border-radius: 50px;
    font-weight: 500;
    font-size: 0.75rem;
}

.badge.bg-success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%) !important;
}

.badge.bg-secondary {
    background: var(--gray-500) !important;
}

.badge.bg-info {
    background: linear-gradient(135deg, var(--info) 0%, #2563eb 100%) !important;
}

/* ---------- Список групп ---------- */
.list-group-item {
    border: none;
    border-bottom: 1px solid var(--gray-100);
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.list-group-item:last-child {
    border-bottom: none;
}

.list-group-item:hover {
    background: var(--gray-50);
    padding-left: 0.5rem;
}

/* ---------- Уведомления (тосты) ---------- */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: white;
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 280px;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ---------- Футер (исправлен) ---------- */
footer {
    background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-800) 100%);
    color: var(--gray-400);
    padding: 3rem 0 2rem;
    margin-top: 4rem;
    flex-shrink: 0;
    text-align: center;
}

footer .container {
    text-align: center;
}

footer p {
    margin-bottom: 0.5rem;
}

footer small {
    color: var(--gray-500);
}

footer i {
    color: var(--primary);
    margin-right: 0.25rem;
}

/* ---------- Анимация загрузки ---------- */
.loading-spinner {
    text-align: center;
    padding: 3rem;
}

.loading-spinner .spinner-border {
    width: 3rem;
    height: 3rem;
    color: var(--primary);
}

/* ---------- Адаптивность ---------- */
@media (max-width: 768px) {
    .hero-gradient {
        padding: 2rem 1rem;
    }
    
    .hero-gradient h1 {
        font-size: 2rem;
    }
    
    .hero-gradient .lead {
        font-size: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-lg {
        padding: 0.625rem 1.25rem;
        font-size: 0.95rem;
    }
    
    .toast-container {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
    
    .toast {
        width: calc(100% - 2rem);
        min-width: auto;
    }
    
    footer {
        padding: 2rem 1rem;
    }
}

@media (max-width: 576px) {
    .product-card img {
        height: 160px;
    }
    
    .price-tag {
        font-size: 1rem;
    }
}

/* ---------- Анимации ---------- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* ---------- Утилиты ---------- */
.text-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.shadow-hover {
    transition: all 0.3s ease;
}

.shadow-hover:hover {
    box-shadow: var(--shadow-xl);
}

.cursor-pointer {
    cursor: pointer;
}

/* ---------- Секция с иконками на лендинге ---------- */
.features-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: inline-block;
}

.features-icon i {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---------- Кастомный скроллбар ---------- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* ---------- Dropdown меню ---------- */
.dropdown-menu {
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.dropdown-item {
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: var(--gray-100);
    transform: translateX(4px);
}

.dropdown-item.text-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* ---------- Пагинация ---------- */
.pagination .page-link {
    border: none;
    color: var(--gray-600);
    border-radius: var(--radius-sm);
    margin: 0 0.25rem;
    transition: all 0.3s ease;
}

.pagination .page-link:hover {
    background: var(--gray-100);
    color: var(--primary);
    transform: translateY(-2px);
}

.pagination .active .page-link {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

/* ---------- Модальные окна ---------- */
.modal-content {
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}

.modal-header {
    border-bottom: 2px solid var(--gray-100);
    padding: 1.25rem 1.5rem;
}

.modal-footer {
    border-top: 2px solid var(--gray-100);
    padding: 1.25rem 1.5rem;
}

/* ---------- Алерты ---------- */
.alert {
    border: none;
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
}

.alert-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.1) 100%);
    color: var(--danger);
    border-left: 4px solid var(--danger);
}

.alert-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
    color: var(--success);
    border-left: 4px solid var(--success);
}

/* ---------- Аватар ---------- */
.avatar-placeholder {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

/* ---------- Бейдж вишлиста ---------- */
.wishlist-badge {
    background: linear-gradient(135deg, var(--secondary) 0%, #db2777 100%);
    color: white;
    border-radius: 50px;
    padding: 0.25rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 600;
}

/* ---------- Бейдж схожести ---------- */
.similarity-badge {
    background: var(--gray-100);
    color: var(--gray-600);
    border-radius: 50px;
    font-size: 0.7rem;
    padding: 0.25rem 0.75rem;
}

/* ---------- Галерея товаров ---------- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 640px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1rem;
    }
}

/* ---------- Пустые состояния ---------- */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.empty-state i {
    font-size: 4rem;
    color: var(--gray-300);
    margin-bottom: 1rem;
}

.empty-state p {
    color: var(--gray-500);
    margin-bottom: 1.5rem;
}

/* ---------- Бренд-цвета ---------- */
.text-primary {
    color: var(--primary) !important;
}

.bg-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

/* ---------- Карточки вишлистов ---------- */
.wishlist-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.wishlist-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.wishlist-card h5 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.wishlist-card p {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* ---------- Исправление футера (основное) ---------- */
html {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1 0 auto;
}

footer {
    flex-shrink: 0;
    width: 100%;
}

/* ---------- Дополнительные эффекты ---------- */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* ---------- Адаптивный футер ---------- */
@media (max-width: 768px) {
    footer {
        text-align: center;
    }
    
    footer .container {
        text-align: center;
    }
}