/* Uvimarket - Обновленный дизайн с новой цветовой схемой */

:root {
    /* Светлая тема (по умолчанию) */
    --bg-primary: #e2e2e2;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f5f5f5;
    --bg-card: #ffffff;
    --bg-hover: #d5d5d5;
    --bg-input: #f0f0f0;
    
    --text-primary: #28242a;
    --text-secondary: #3d3840;
    --text-tertiary: #6b6670;
    --text-muted: #99949e;
    --text-inverse: #e2e2e2;
    
    --border-color: #c9c9c9;
    --border-light: #e0e0e0;
    
    /* Основные цвета бренда */
    --primary-red: #df0139;
    --primary-red-hover: #b8012f;
    --primary-red-light: rgba(223, 1, 57, 0.1);
    --primary-red-dark: #8a012b;
    
    --dark-bg: #1e1e27;
    --dark-surface: #28242a;
    
    --shadow: 0 4px 6px -1px rgba(40, 36, 42, 0.15), 0 2px 4px -1px rgba(40, 36, 42, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(40, 36, 42, 0.2), 0 4px 6px -2px rgba(40, 36, 42, 0.1);
    --shadow-glow: 0 0 25px rgba(223, 1, 57, 0.35);
    
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    
    --gradient-red: linear-gradient(135deg, #df0139, #b8012f);
    --gradient-dark: linear-gradient(135deg, #1e1e27, #28242a);
    --gradient-card: linear-gradient(145deg, #ffffff, #f8f8f8);
    --gradient-header: linear-gradient(135deg, #1e1e27, #28242a);
}

/* Темная тема */
[data-theme="dark"] {
    --bg-primary: #1e1e27;
    --bg-secondary: #28242a;
    --bg-tertiary: #322d36;
    --bg-card: #28242a;
    --bg-hover: #3a3540;
    --bg-input: #322d36;
    
    --text-primary: #e2e2e2;
    --text-secondary: #c9c9c9;
    --text-tertiary: #a3a3a3;
    --text-muted: #7a7a7a;
    --text-inverse: #1e1e27;
    
    --border-color: #3a3540;
    --border-light: #403a45;
    
    --primary-red: #df0139;
    --primary-red-hover: #ff0a4a;
    --primary-red-light: rgba(223, 1, 57, 0.15);
    --primary-red-dark: #b8012f;
    
    --dark-bg: #1e1e27;
    --dark-surface: #28242a;
    
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px rgba(223, 1, 57, 0.5);
    
    --gradient-card: linear-gradient(145deg, #28242a, #322d36);
    --gradient-header: linear-gradient(135deg, #1e1e27, #28242a);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.35s ease, color 0.35s ease;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: var(--gradient-header);
    color: var(--text-inverse);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
    border-bottom: 2px solid var(--primary-red);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 32px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo,
.logo:link,
.logo:visited,
.logo:hover,
.logo:active {
    color: #ffffff !important;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: var(--gradient-red);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 24px;
    color: #ffffff !important;
    box-shadow: var(--shadow-glow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.logo:hover .logo-icon {
    transform: scale(1.05);
    box-shadow: 0 0 35px rgba(223, 1, 57, 0.6);
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #ffffff !important;
}

/* Темная тема - принудительно белый логотип */
[data-theme="dark"] .logo,
[data-theme="dark"] .logo-text,
[data-theme="dark"] .logo-icon {
    color: #ffffff !important;
}

.search-form {
    flex: 1;
    max-width: 560px;
    display: flex;
    gap: 0;
}

.search-form input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid transparent;
    border-radius: var(--radius) 0 0 var(--radius);
    font-size: 15px;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: all 0.2s;
}

.search-form input:focus {
    outline: none;
    border-color: var(--primary-red);
    background: var(--bg-secondary);
}

.search-form input::placeholder {
    color: var(--text-muted);
}

.btn-search {
    padding: 12px 20px;
    background: var(--primary-red);
    border: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    cursor: pointer;
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    transition: all 0.2s;
    font-weight: 500;
}

.btn-search:hover {
    background: var(--primary-red-hover);
    box-shadow: var(--shadow-glow);
    transform: translateX(2px);
}

.nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    flex-wrap: nowrap;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--text-inverse);
    background: rgba(223, 1, 57, 0.2);
}

/* Icon-only nav links for mobile */
.nav-icon {
    display: none;
}

.nav-text {
    display: inline;
}

/* Desktop elements */
.nav-desktop {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Mobile dropdown */
.nav-mobile-dropdown {
    display: none;
    position: relative;
    z-index: 9999;
}

.avatar-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 10000;
}

.avatar-btn .avatar-small,
.avatar-btn .avatar-placeholder {
    border: 2px solid var(--primary-red);
}

.mobile-dropdown {
    display: none;
    position: fixed;
    top: 60px;
    right: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    z-index: 10001;
    overflow: hidden;
}

.mobile-dropdown.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

.mobile-dropdown-header {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.avatar-medium {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-red);
}

.avatar-large {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-red);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
}

.mobile-username {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.mobile-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
    font-family: inherit;
}

.mobile-dropdown-item:hover {
    background: var(--bg-hover);
}

.mobile-dropdown-item svg {
    flex-shrink: 0;
}

.theme-toggle-mobile {
    color: var(--text-primary);
}

.logout-item {
    color: var(--primary-red);
    border-top: 1px solid var(--border-color);
}

.logout-item:hover {
    background: var(--primary-red-light);
}

.nav-link .badge {
    background: var(--primary-red);
    color: var(--text-inverse);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    box-shadow: var(--shadow-glow);
}

/* Compact button for nav */
.btn-compact {
    padding: 8px 14px;
    font-size: 13px;
    white-space: nowrap;
}

.nav-link .badge {
    background: var(--primary-red);
    color: var(--text-inverse);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    box-shadow: var(--shadow-glow);
}

.avatar-small {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-red);
}

.avatar-placeholder {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gradient-red);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

/* Theme Toggle */
.theme-toggle {
    background: transparent;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    cursor: pointer;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.theme-toggle:hover {
    background: var(--bg-hover);
    border-color: var(--primary-red);
    color: var(--primary-red);
    box-shadow: 0 0 15px rgba(223, 1, 57, 0.2);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--gradient-red);
    color: var(--text-inverse);
    box-shadow: 0 3px 6px rgba(223, 1, 57, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--bg-hover);
    border-color: var(--primary-red);
    color: var(--primary-red);
}

.btn-danger {
    background: var(--primary-red);
    color: var(--text-inverse);
}

.btn-danger:hover {
    background: var(--primary-red-dark);
    box-shadow: var(--shadow-glow);
}

/* Main */
.main {
    flex: 1;
    padding: 32px 0;
}

/* Alerts */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border-left-color: #22c55e;
}

.alert-error {
    background: rgba(223, 1, 57, 0.1);
    color: var(--primary-red);
    border-left-color: var(--primary-red);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-left-color: #3b82f6;
}

/* Cards Grid */
.ads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.ad-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
    display: block;
    border: 1px solid var(--border-light);
    position: relative;
}

.ad-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-red);
    opacity: 0;
    transition: opacity 0.3s;
}

.ad-card:hover::before {
    opacity: 1;
}

.ad-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    border-color: var(--primary-red);
}

.ad-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--bg-tertiary);
    transition: transform 0.4s;
}

.ad-card:hover .ad-card-image {
    transform: scale(1.1);
}

.ad-card-image-wrapper {
    overflow: hidden;
    position: relative;
}

.ad-card-content {
    padding: 16px;
    background: var(--gradient-card);
}

.ad-card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ad-card-price {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-red);
    margin-bottom: 8px;
    text-shadow: 0 0 10px rgba(223, 1, 57, 0.2);
}

.ad-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-tertiary);
}

.ad-card-location {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Ad Detail */
.ad-detail {
    display: grid;
    grid-template-columns: 1fr minmax(300px, 400px);
    gap: 32px;
    margin-top: 24px;
    align-items: start;
}

.ad-images {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    min-width: 0;
}

.ad-main-image {
    width: 100%;
    height: 450px;
    object-fit: cover;
    background: var(--bg-tertiary);
    display: block;
}

.ad-thumbnails {
    display: flex;
    gap: 8px;
    padding: 16px;
    overflow-x: auto;
    background: var(--bg-secondary);
}

.ad-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    display: block;
    flex-shrink: 0;
}

.ad-thumbnail:hover,
.ad-thumbnail.active {
    border-color: var(--primary-red);
    box-shadow: var(--shadow-glow);
}

.ad-info {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    width: 100%;
    box-sizing: border-box;
}

.ad-price {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary-red);
    margin-bottom: 16px;
    text-shadow: var(--shadow-glow);
}

.ad-title {
    font-size: 26px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.ad-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--text-tertiary);
    flex-wrap: wrap;
}

.ad-description {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    line-height: 1.8;
    color: var(--text-secondary);
}

.ad-description h3 {
    font-size: 18px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

/* Seller Info */
.seller-info {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.seller-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.seller-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gradient-red);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    box-shadow: var(--shadow-glow);
}

.seller-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
}

.seller-status {
    font-size: 13px;
    color: var(--text-tertiary);
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

.contact-icon {
    width: 36px;
    height: 36px;
    background: var(--primary-red-light);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-red);
}

/* Message Form */
.message-form {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
    background: var(--bg-input);
    color: var(--text-primary);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 4px var(--primary-red-light);
    background: var(--bg-secondary);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* Categories */
.categories-list {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.category-chip {
    padding: 10px 18px;
    background: var(--bg-card);
    border-radius: 24px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow);
    transition: all 0.25s;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 2px solid var(--border-color);
}

.category-chip:hover {
    background: var(--primary-red);
    color: var(--text-inverse);
    border-color: var(--primary-red);
    box-shadow: var(--shadow-glow);
    transform: translateY(-3px);
}

.category-chip.active {
    background: var(--gradient-red);
    color: var(--text-inverse);
    border-color: var(--primary-red);
    box-shadow: var(--shadow-glow);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.page-link {
    padding: 10px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    box-shadow: var(--shadow);
    transition: all 0.2s;
    border: 2px solid var(--border-color);
}

.page-link:hover,
.page-link.active {
    background: var(--gradient-red);
    color: var(--text-inverse);
    border-color: var(--primary-red);
    box-shadow: var(--shadow-glow);
    transform: translateY(-3px);
}

.page-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Auth Forms */
.auth-container {
    max-width: 420px;
    margin: 40px auto;
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
    color: var(--text-primary);
}

.auth-subtitle {
    text-align: center;
    color: var(--text-tertiary);
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-secondary);
}

/* Create Ad */
.create-ad-container {
    max-width: 800px;
    margin: 0 auto;
}

.create-ad-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.create-ad-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.image-upload {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    margin-bottom: 20px;
    transition: all 0.2s;
    background: var(--bg-tertiary);
}

.image-upload:hover {
    border-color: var(--primary-red);
    background: var(--primary-red-light);
}

/* Inbox */
.messages-list {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.message-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.message-item:hover {
    background: var(--bg-hover);
}

.message-item:last-child {
    border-bottom: none;
}

.message-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gradient-red);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    margin-right: 16px;
    flex-shrink: 0;
    box-shadow: var(--shadow-glow);
}

.message-content {
    flex: 1;
    min-width: 0;
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.message-sender {
    font-weight: 600;
    color: var(--text-primary);
}

.message-time {
    font-size: 13px;
    color: var(--text-tertiary);
}

.message-preview {
    font-size: 14px;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-unread {
    background: var(--primary-red-light);
    border-left: 3px solid var(--primary-red);
}

/* Conversation */
.conversation-container {
    max-width: 800px;
    margin: 0 auto;
}

.conversation-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.conversation-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-secondary);
}

.conversation-messages {
    padding: 24px;
    max-height: 500px;
    overflow-y: auto;
    background: var(--bg-tertiary);
}

.conversation-message {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
}

.conversation-message.sent {
    align-items: flex-end;
}

.message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: var(--radius);
    word-wrap: break-word;
}

.conversation-message.sent .message-bubble {
    background: var(--gradient-red);
    color: var(--text-inverse);
    border-bottom-right-radius: 4px;
    box-shadow: var(--shadow-glow);
}

.conversation-message.received .message-bubble {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-color);
}

.message-meta {
    font-size: 11px;
    margin-top: 4px;
    color: var(--text-tertiary);
}

.conversation-form {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    background: var(--bg-secondary);
}

/* Profile */
.profile-container {
    max-width: 800px;
    margin: 0 auto;
}

.profile-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border-color);
}

.profile-avatar-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--gradient-red);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: 600;
    box-shadow: var(--shadow-glow);
}

.profile-avatar-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-red);
}

.profile-info h2 {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.profile-info p {
    color: var(--text-tertiary);
}

/* Footer */
.footer {
    background: var(--gradient-header);
    color: var(--text-tertiary);
    padding: 48px 0 24px;
    margin-top: auto;
    border-top: 2px solid var(--primary-red);
    flex-shrink: 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
    margin-bottom: 32px;
}

.footer-section h4 {
    color: var(--text-inverse);
    font-size: 16px;
    margin-bottom: 16px;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 10px;
}

.footer-section a {
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-section a:hover {
    color: var(--primary-red);
}

/* Исключение для кнопок соцсетей - отменяем все трансформации */
.footer-section .social-link {
    padding-left: 0 !important;
    transform: none !important;
    font-size: 14px !important;
    transition: background 0.25s, border-color 0.25s, color 0.25s, box-shadow 0.25s !important;
}

.footer-section .social-link:hover {
    padding-left: 0 !important;
    transform: none !important;
    font-size: 14px !important;
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-link {
    padding: 10px 18px !important;
    background: var(--dark-surface);
    border-radius: var(--radius-sm);
    color: var(--text-inverse);
    text-decoration: none;
    font-size: 14px !important;
    font-weight: 500;
    transition: background 0.25s, border-color 0.25s, color 0.25s, box-shadow 0.25s !important;
    border: 1px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    transform: none !important;
    min-width: 140px;
}

.social-link .social-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.social-link svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.social-link:hover {
    background: var(--bg-hover);
    border-color: var(--primary-red);
    color: var(--primary-red);
    box-shadow: 0 4px 12px rgba(223, 1, 57, 0.3);
    transform: none !important;
    font-size: 14px !important;
}

/* Discord specific colors */
.social-discord:hover {
    background: #5865F2;
    border-color: #5865F2;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.4);
    transform: none !important;
}

/* Telegram specific colors */
.social-telegram:hover {
    background: #0088cc;
    border-color: #0088cc;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 136, 204, 0.4);
    transform: none !important;
}

.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
}

/* Similar Ads */
.similar-ads {
    margin-top: 48px;
}

.similar-ads h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state-text {
    color: var(--text-tertiary);
    margin-bottom: 24px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-red);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-red-hover);
    box-shadow: var(--shadow-glow);
}

/* Responsive */

/* Tablet */
@media (max-width: 1024px) {
    .ad-detail {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
    }

    .ad-info {
        order: -1;
    }

    .header-content {
        gap: 20px;
    }

    .nav {
        gap: 10px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .header {
        padding: 12px 0;
    }

    .header-content {
        flex-wrap: wrap;
        gap: 12px;
    }

    .logo-icon {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }

    .logo-text {
        font-size: 20px;
    }

    .search-form {
        order: 3;
        max-width: 100%;
        width: 100%;
    }

    .search-form input {
        padding: 10px 16px;
        font-size: 14px;
    }

    .btn-search {
        padding: 10px 16px;
    }

    .nav {
        margin-left: 0;
        overflow-x: auto;
        width: 100%;
        gap: 8px;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .nav::-webkit-scrollbar {
        height: 0;
    }

    /* Hide desktop elements on mobile */
    .nav-desktop {
        display: none;
    }

    .theme-toggle-desktop {
        display: none;
    }

    /* Show mobile dropdown */
    .nav-mobile-dropdown {
        display: block;
        margin-left: auto;
    }

    /* Show text on mobile too */
    .nav-icon {
        display: none;
    }

    .nav-text {
        display: inline;
    }

    .btn-compact {
        padding: 8px 12px;
        font-size: 12px;
    }

    .main {
        padding: 20px 0;
        flex: 1 0 auto;
    }

    /* Compact footer on mobile */
    .footer {
        padding: 0;
    }

    .footer-content {
        display: flex;
        flex-direction: column;
        gap: 0;
        margin-bottom: 0;
    }

    .footer-section {
        padding: 0;
        margin: 0;
    }

    /* Hide all sections except "Помощь" on mobile */
    .footer-section:first-child,
    .footer-section:nth-child(2),
    .footer-section:last-child {
        display: none;
    }

    .footer-section h4 {
        font-size: 12px;
        margin-bottom: 2px;
    }

    .footer-section ul {
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .footer-section li {
        margin-bottom: 1px;
        line-height: 1.3;
    }

    .footer-section a {
        font-size: 11px;
    }

    .footer-bottom {
        padding-top: 2px;
        font-size: 10px;
        margin-top: 2px;
    }

    .ads-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .ad-card-image {
        height: 160px;
    }

    .ad-card-content {
        padding: 12px;
    }

    .ad-card-title {
        font-size: 14px;
    }

    .ad-card-price {
        font-size: 18px;
    }

    .ad-card-meta {
        font-size: 12px;
    }

    .categories-list {
        gap: 8px;
    }

    .category-chip {
        padding: 6px 12px;
        font-size: 13px;
    }

    .ad-detail {
        gap: 16px;
    }

    .ad-main-image {
        height: 300px;
    }

    .ad-thumbnails {
        padding: 12px;
    }

    .ad-thumbnail {
        width: 60px;
        height: 60px;
    }

    .ad-price {
        font-size: 28px;
    }

    .ad-title {
        font-size: 22px;
    }

    .ad-meta {
        font-size: 13px;
        gap: 12px;
    }

    .seller-avatar {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .message-bubble {
        max-width: 85%;
    }

    .conversation-messages {
        padding: 16px;
        max-height: 400px;
    }

    .conversation-form {
        padding: 16px;
        flex-direction: column;
    }

    .auth-card {
        padding: 24px;
    }

    .create-ad-card {
        padding: 20px;
    }

    .profile-card {
        padding: 20px;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .profile-avatar-large,
    .profile-avatar-img {
        width: 80px;
        height: 80px;
        font-size: 32px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    .header-content {
        gap: 10px;
    }

    .logo-icon {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }

    .logo-text {
        font-size: 18px;
    }

    .search-form input {
        padding: 8px 14px;
        font-size: 13px;
    }

    .btn-search {
        padding: 8px 14px;
    }

    .nav {
        gap: 6px;
    }

    .nav-link {
        font-size: 12px;
        padding: 5px 8px;
    }

    .btn-compact {
        padding: 6px 10px;
        font-size: 11px;
    }

    .ads-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .ad-card-image {
        height: 200px;
    }

    .ad-card-content {
        padding: 14px;
    }

    .ad-card-title {
        font-size: 16px;
    }

    .ad-card-price {
        font-size: 20px;
    }

    .ad-main-image {
        height: 250px;
    }

    .ad-thumbnails {
        padding: 10px;
        gap: 6px;
    }

    .ad-thumbnail {
        width: 50px;
        height: 50px;
    }

    .ad-price {
        font-size: 24px;
    }

    .ad-title {
        font-size: 20px;
    }

    .ad-description {
        font-size: 14px;
    }

    .message-bubble {
        max-width: 90%;
    }

    .conversation-messages {
        padding: 12px;
        max-height: 350px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .footer-section h4 {
        font-size: 15px;
    }

    .social-links {
        flex-direction: column;
    }

    .social-link {
        width: 100%;
        justify-content: center;
    }

    .auth-card {
        padding: 20px;
    }

    .auth-title {
        font-size: 22px;
    }

    .create-ad-card {
        padding: 16px;
    }

    .create-ad-title {
        font-size: 20px;
    }

    .profile-card {
        padding: 16px;
    }

    .profile-avatar-large,
    .profile-avatar-img {
        width: 70px;
        height: 70px;
        font-size: 28px;
    }

    .profile-info h2 {
        font-size: 20px;
    }

    .pagination {
        gap: 6px;
    }

    .page-link {
        padding: 8px 12px;
        font-size: 13px;
    }

    .empty-state {
        padding: 40px 16px;
    }

    .empty-state-icon {
        font-size: 48px;
    }

    .empty-state-title {
        font-size: 18px;
    }
}

/* Extra Small */
@media (max-width: 360px) {
    .container {
        padding: 0 10px;
    }

    .logo-icon {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }

    .logo-text {
        font-size: 16px;
    }

    .search-form input {
        padding: 8px 12px;
        font-size: 12px;
    }

    .btn-search {
        padding: 8px 12px;
    }

    .nav-link {
        font-size: 11px;
        padding: 4px 6px;
    }

    .btn-compact {
        padding: 5px 8px;
        font-size: 10px;
    }

    .ad-card-image {
        height: 180px;
    }
}

/* Landscape mode */
@media (max-width: 768px) and (orientation: landscape) {
    .header {
        position: relative;
    }

    .ad-main-image {
        height: 200px;
    }

    .conversation-messages {
        max-height: 300px;
    }
}

/* Hover only on devices that support it */
@media (hover: hover) {
    .ad-card:hover {
        transform: translateY(-8px) scale(1.02);
    }

    .ad-card:hover .ad-card-image {
        transform: scale(1.1);
    }

    .category-chip:hover {
        transform: translateY(-3px);
    }

    .page-link:hover {
        transform: translateY(-3px);
    }

    .social-link:hover {
        transform: translateY(-3px);
    }
}

/* No hover on touch devices */
@media (hover: none) {
    .ad-card:active {
        transform: scale(0.98);
    }

    .category-chip:active {
        transform: scale(0.95);
    }

    .btn:active {
        transform: scale(0.95);
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(223, 1, 57, 0.3); }
    50% { box-shadow: 0 0 30px rgba(223, 1, 57, 0.5); }
}

.ad-card,
.message-item,
.category-chip {
    animation: fadeIn 0.4s ease;
}

/* Focus styles for accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--primary-red);
    outline-offset: 2px;
}

/* Selection color */
::selection {
    background: var(--primary-red);
    color: var(--text-inverse);
}

/* Loading animation */
@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: 200px 0; }
}

.loading {
    background: linear-gradient(90deg, var(--bg-tertiary) 0%, var(--bg-hover) 50%, var(--bg-tertiary) 100%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}
