/* Единые стили для всех страниц - Telegram Style */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol' !important;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol' !important;
    background: linear-gradient(180deg, #f0f2f5 0%, #ffffff 100%);
    background-attachment: fixed;
    color: #000;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    font-feature-settings: "liga" 1, "calt" 1 !important;
}

* {
    font-family: inherit !important;
}

/* HEADER - Telegram Style */
.header {
    background: #ffffff !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08) !important;
    width: 100% !important;
}

/* Глобально скрываем пункт навигации "Блог" (страницу/логику не удаляем) */
#nav-blog {
    display: none !important;
}

.header-content {
    max-width: 1400px !important;
    margin: 0 auto !important;
    padding: 14px 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 40px !important;
    min-height: 60px !important;
}

.logo {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    background: linear-gradient(135deg, #3390ec 0%, #2481cc 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    flex-shrink: 0 !important;
    padding: 4px 0 !important;
}

.logo:hover {
    opacity: 0.85;
}

.logo-icon {
    width: 36px !important;
    height: 36px !important;
    display: inline-block !important;
    vertical-align: middle !important;
    flex-shrink: 0;
    object-fit: contain;
}

.logo-image {
    width: 42px !important;
    height: 42px !important;
    max-width: 42px !important;
    max-height: 42px !important;
    min-width: 42px !important;
    min-height: 42px !important;
    object-fit: contain !important;
    flex-shrink: 0 !important;
    display: block !important;
    background: transparent !important;
    transition: transform 0.2s ease !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
}

.logo img,
.logo svg {
    width: 42px !important;
    height: 42px !important;
    max-width: 42px !important;
    max-height: 42px !important;
}

.logo:hover .logo-image {
    transform: scale(1.05);
}

.logo-image[alt="versicolora.com"] {
    object-fit: contain;
    object-position: center;
}

/* Telegram Style Icons */
.tg-icon {
    width: 18px !important;
    height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    display: inline-block !important;
    vertical-align: middle !important;
    fill: currentColor !important;
    stroke: currentColor !important;
    margin-right: 0 !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
}

.tg-icon path,
.tg-icon circle,
.tg-icon rect {
    fill: currentColor !important;
    stroke: currentColor !important;
}

/* Ограничение для всех SVG в header */
.header svg,
.header .tg-icon,
.nav-link svg {
    width: 18px !important;
    height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
}

.nav-link .tg-icon {
    opacity: 0.7;
    transition: opacity 0.2s;
}

.nav-link:hover .tg-icon,
.nav-link.active .tg-icon {
    opacity: 1;
}

.tg-icon-large {
    width: 24px !important;
    height: 24px !important;
}

.tg-icon-small {
    width: 16px !important;
    height: 16px !important;
}

.icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.nav-link svg {
    display: inline-block !important;
    vertical-align: middle !important;
}

.section-title svg,
.search-title svg,
.auctions-title svg {
    display: inline-block !important;
    vertical-align: middle !important;
}

svg.logo-icon,
svg.tg-icon {
    visibility: visible !important;
    opacity: 1 !important;
}

.nav-links {
    display: flex !important;
    gap: 6px !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    justify-content: flex-end !important;
    flex: 1 1 auto !important;
    margin-left: auto !important;
}

.nav-link {
    color: #4A5568 !important;
    text-decoration: none !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    position: relative !important;
    padding: 10px 18px !important;
    border-radius: 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    white-space: nowrap !important;
    border: 1px solid transparent !important;
    line-height: 1.4 !important;
}

.nav-link::after {
    display: none !important;
}

.nav-link:hover {
    color: #3390ec !important;
    background: rgba(51, 144, 236, 0.12) !important;
    border-color: rgba(51, 144, 236, 0.2) !important;
    transform: translateY(-1px) !important;
}

.nav-link.active {
    color: #ffffff !important;
    font-weight: 600 !important;
    background: linear-gradient(135deg, #3390ec 0%, #2481cc 100%) !important;
    border-color: #3390ec !important;
    box-shadow: 0 2px 8px rgba(51, 144, 236, 0.3) !important;
}

/* Стили для авторизованного пользователя */
.nav-link.user-logged-in {
    font-weight: 600;
    color: #3390ec;
}

.nav-link.user-logged-in:hover {
    background: rgba(51, 144, 236, 0.12);
}

.nav-link.active::after {
    width: 100%;
}

/* MAIN CONTAINER */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 24px;
}

/* PAGE CONTENT WRAPPER - для единообразия */
.page-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 24px;
}

/* CARDS - единый стиль для всех карточек */
.card,
.info-card,
.profile-card,
.auction-card {
    background: #fff;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 20px;
}

.card:hover,
.info-card:hover,
.profile-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

/* SECTIONS - единый стиль для секций */
.section {
    margin-bottom: 40px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #000;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* BUTTONS - единый стиль для кнопок */
.btn-primary,
.primary-button {
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
    background: linear-gradient(135deg, #3390ec 0%, #2481cc 100%);
    border: none;
    border-radius: 16px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(51, 144, 236, 0.3);
}

.btn-primary:hover,
.primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(51, 144, 236, 0.4);
}

.btn-secondary,
.secondary-button {
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
    background: #f0f2f5;
    border: 2px solid #e4e6eb;
    border-radius: 16px;
    color: #707579;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover,
.secondary-button:hover {
    background: #e4e6eb;
    border-color: #3390ec;
    color: #3390ec;
}

/* INPUTS - единый стиль для полей ввода */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
textarea,
select {
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
    border: 2px solid #e4e6eb;
    border-radius: 16px;
    background: #f0f2f5;
    transition: all 0.3s;
    font-family: inherit;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #3390ec;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(51, 144, 236, 0.1);
}

/* BADGES - единый стиль для бейджей */
.badge,
.category-badge {
    display: inline-block;
    padding: 6px 12px;
    background: #f0f2f5;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #707579;
}

.badge-primary {
    background: linear-gradient(135deg, #3390ec 0%, #2481cc 100%);
    color: #fff;
}

.badge-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-warning {
    background: #fff3e0;
    color: #e65100;
}

.badge-danger {
    background: #ffebee;
    color: #c62828;
}

/* PAGE TRANSITIONS */
body {
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

body.page-loading {
    opacity: 0;
}

body.page-loaded {
    opacity: 1;
    animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* IMPROVED NAVIGATION */
.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(51, 144, 236, 0.1), transparent);
    transition: left 0.5s;
}

.nav-link:hover::before {
    left: 100%;
}

.nav-link:hover {
    background: rgba(51, 144, 236, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(51, 144, 236, 0.15);
}

.nav-link.active {
    background: rgba(51, 144, 236, 0.12);
    color: #3390ec;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(51, 144, 236, 0.2);
}

.nav-link.active::after {
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #3390ec, #2481cc);
    border-radius: 0 0 4px 4px;
}

.nav-link-loading {
    position: relative;
    pointer-events: none;
}

.nav-link-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(51, 144, 236, 0.3);
    border-top-color: #3390ec;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* MOBILE MENU */
.mobile-menu-button {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
    position: relative;
}

.menu-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 24px;
    height: 18px;
}

.menu-icon span {
    display: block;
    width: 100%;
    height: 2px;
    background: #3390ec;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-button.active .menu-icon span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-button.active .menu-icon span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-button.active .menu-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

body.menu-open {
    overflow: hidden;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .header-content {
        padding: 10px 20px;
        gap: 16px;
    }
    
    .logo {
        font-size: 18px;
        gap: 8px;
    }
    
    .logo-image,
    .logo-icon {
        width: 32px !important;
        height: 32px !important;
    }
    
    .nav-links {
        gap: 4px;
        flex-wrap: wrap;
    }
    
    .nav-link {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .nav-link .tg-icon {
        width: 16px !important;
        height: 16px !important;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 8px 16px;
        gap: 12px;
    }
    
    .logo {
        font-size: 16px;
        gap: 6px;
    }
    
    .logo-image,
    .logo-icon {
        width: 28px !important;
        height: 28px !important;
    }
    
    .nav-links {
        gap: 2px;
    }
    
    .nav-link {
        padding: 5px 8px;
        font-size: 12px;
    }
    
    .nav-link .tg-icon {
        width: 14px !important;
        height: 14px !important;
    }
    
    /* Скрываем текст на очень маленьких экранах, оставляем только иконки */
    .nav-link span:not(.tg-icon) {
        display: none;
    }
}

/* SMOOTH SCROLL */
html {
    scroll-behavior: smooth;
}

/* =========================================================
   Mobile-first improvements (safe-area, nav drawer, tap UX)
   ========================================================= */

:root {
    --vc-bg: #f0f2f5;
    --vc-surface: #ffffff;
    --vc-text: #0f172a;
    --vc-muted: #64748b;
    --vc-border: rgba(15, 23, 42, 0.10);
    --vc-primary: #3390ec;
    --vc-primary-2: #2481cc;
    --vc-radius-lg: 18px;
    --vc-radius-md: 14px;
    --vc-shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.06);
    --vc-shadow-md: 0 10px 30px rgba(15, 23, 42, 0.12);
    --vc-safe-top: env(safe-area-inset-top, 0px);
    --vc-safe-right: env(safe-area-inset-right, 0px);
    --vc-safe-bottom: env(safe-area-inset-bottom, 0px);
    --vc-safe-left: env(safe-area-inset-left, 0px);
}

html, body {
    height: 100%;
}

body {
    background: linear-gradient(180deg, var(--vc-bg) 0%, #ffffff 100%) !important;
    color: var(--vc-text) !important;
    -webkit-text-size-adjust: 100%;
    text-rendering: optimizeLegibility;
}

/* Better tap UX on mobile */
* {
    -webkit-tap-highlight-color: transparent;
}

button,
a,
input,
select,
textarea {
    touch-action: manipulation;
}

/* Prevent "sticky header hides on scroll" behavior on touch devices */
@media (hover: none) and (pointer: coarse) {
    .header {
        transform: translateY(0) !important;
    }
}

/* Global content paddings for mobile */
@media (max-width: 768px) {
    .container,
    .page-content {
        padding: 20px 16px !important;
    }
}

@media (max-width: 480px) {
    .container,
    .page-content {
        padding: 16px 14px !important;
        padding-left: calc(14px + var(--vc-safe-left)) !important;
        padding-right: calc(14px + var(--vc-safe-right)) !important;
        padding-bottom: calc(16px + var(--vc-safe-bottom)) !important;
    }
}

/* Header: safe-area + clean spacing on mobile */
@media (max-width: 768px) {
    .header {
        top: 0 !important;
        padding-top: var(--vc-safe-top) !important;
        box-shadow: var(--vc-shadow-sm) !important;
    }

    .header-content {
        padding: 10px 14px !important;
        padding-left: calc(14px + var(--vc-safe-left)) !important;
        padding-right: calc(14px + var(--vc-safe-right)) !important;
        gap: 12px !important;
        min-height: 56px !important;
    }

    .logo {
        font-size: 16px !important;
        gap: 8px !important;
        max-width: 60vw;
    }

    .logo span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Mobile menu: show burger, turn nav into drawer */
@media (max-width: 768px) {
    .mobile-menu-button {
        /* Burger menu is intentionally removed from mobile header UX */
        display: none !important;
    }

    .mobile-menu-button:active {
        transform: scale(0.98);
    }

    /* Keep navigation links visible (no drawer) */
    .header .nav-links {
        display: flex !important;
    }

    .header .nav-links.mobile-menu-open {
        /* Drawer mode disabled */
        position: static !important;
        inset: auto !important;
        z-index: auto !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 8px !important;
        padding: 0 !important;
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        overflow: visible !important;
    }

    .header .nav-links.mobile-menu-open .nav-link {
        width: auto !important;
    }

    .header .nav-links.mobile-menu-open .nav-link.active {
        /* No special drawer styling */
    }

    /* Hide hover lift on touch */
    .nav-link:hover {
        transform: none !important;
        box-shadow: none !important;
    }
}

/* Cards: nicer mobile density and readable text */
@media (max-width: 768px) {
    .card,
    .info-card,
    .profile-card,
    .auction-card {
        border-radius: var(--vc-radius-lg) !important;
        padding: 16px !important;
        box-shadow: var(--vc-shadow-sm) !important;
        margin-bottom: 14px !important;
        transform: none !important;
    }

    .section-title {
        font-size: 20px !important;
        margin-bottom: 14px !important;
    }

    /* Inputs */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    textarea,
    select {
        border-radius: var(--vc-radius-md) !important;
        padding: 12px 14px !important;
        font-size: 16px !important; /* avoid iOS zoom */
    }

    /* Buttons */
    .btn-primary,
    .primary-button,
    .btn-secondary,
    .secondary-button {
        border-radius: var(--vc-radius-md) !important;
        padding: 12px 16px !important;
        font-size: 15px !important;
    }
}

/* Auctions/card grids used on multiple pages (index/category/profile/etc.) */
@media (max-width: 768px) {
    .auctions-grid,
    .auctions-list,
    #auctions-list,
    #ending-auctions-list,
    #auctions-container {
        width: 100% !important;
    }

    /* If a grid is present, force single column for readability */
    .auctions-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    /* Make images feel consistent */
    .auction-image,
    .auction-image-wrapper img,
    img.auction-image {
        border-radius: 16px !important;
    }

    /* Avoid long titles exploding layout */
    .auction-title,
    .card-title,
    .section-title {
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    /* Reduce hover-only polish that looks janky on touch */
    .auction-card:hover,
    .card:hover,
    .info-card:hover,
    .profile-card:hover {
        transform: none !important;
        box-shadow: var(--vc-shadow-sm) !important;
    }
}

@media (max-width: 480px) {
    .auctions-grid {
        gap: 12px !important;
    }
}


/* BUTTON IMPROVEMENTS */
button,
.btn,
[role="button"] {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

button:hover,
.btn:hover,
[role="button"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(51, 144, 236, 0.2);
}

button:active,
.btn:active,
[role="button"]:active {
    transform: translateY(0);
}

/* LINK IMPROVEMENTS */
a:not(.nav-link):not(.logo) {
    transition: color 0.2s ease, opacity 0.2s ease;
}

a:not(.nav-link):not(.logo):hover {
    opacity: 0.8;
}

/* FOCUS STATES FOR ACCESSIBILITY */
.nav-link:focus,
button:focus,
a:focus {
    outline: 2px solid #3390ec;
    outline-offset: 2px;
    border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* BREADCRUMBS */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 14px;
    color: #707579;
}

.breadcrumbs a {
    color: #3390ec;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumbs a:hover {
    color: #2481cc;
    color: #3390ec !important;
    text-decoration: none !important;
}

.breadcrumbs span {
    color: #707579;
}

.breadcrumbs .separator {
    color: #b0b0b0;
    margin: 0 4px;
}

/* IMPROVED HEADER ANIMATION */
.header {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s ease-in-out;
}

.header.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.98);
}

/* CARD TRANSITIONS */
.auction-card,
.card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.auction-card:hover,
.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(51, 144, 236, 0.15);
}

/* LOADING STATES */
.page-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.page-loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(51, 144, 236, 0.1);
    border-top-color: #3390ec;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

















