/* Reusable Component Library */

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
}

.btn-primary:active {
    transform: scale(0.98);
    opacity: 0.9;
}

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

.btn-ghost {
    background: transparent;
    color: var(--text-color);
}

.btn-outline {
    background: transparent;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
}

.btn-outline:active {
    background: rgba(10, 132, 255, 0.1);
}


.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.btn-block {
    width: 100%;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
}

.card-compact {
    padding: 1rem;
}

.card-horizontal {
    display: flex;
    gap: 1rem;
}

.card-horizontal .card-image {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
}

.card-horizontal .card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Form Elements */
.input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-color);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.input:focus {
    border-color: var(--accent-color);
}

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

.select {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-color);
    font-size: 1rem;
    outline: none;
    cursor: pointer;
}

.toggle {
    position: relative;
    width: 50px;
    height: 28px;
    background: var(--border-color);
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle.active {
    background: var(--accent-color);
}

.toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

.toggle.active::after {
    transform: translateX(22px);
}

.slider {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: var(--border-color);
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    border: none;
}

/* Chips and Badges */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.chip.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.chip i {
    font-size: 0.75rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--accent-color);
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: #30d158;
}

.badge-warning {
    background: #ff9f0a;
}

.badge-error {
    background: #ff375f;
}

/* Divider */
.divider {
    height: 1px;
    background: var(--border-color);
    margin: 1.5rem 0;
}

.divider-vertical {
    width: 1px;
    height: 100%;
    background: var(--border-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state-text {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* List */
.list {
    list-style: none;
}

.list-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.list-item:active {
    background: rgba(255, 255, 255, 0.05);
}

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

.list-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.list-item-content {
    flex: 1;
}

.list-item-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.list-item-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.list-item-action {
    color: var(--text-muted);
}

/* Avatar */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
}

.avatar-large {
    width: 80px;
    height: 80px;
}

.avatar-small {
    width: 24px;
    height: 24px;
}

/* Tag */
.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Rating Stars */
.stars {
    display: inline-flex;
    gap: 0.25rem;
}

.star {
    color: #ff9f0a;
}

.star.empty {
    color: var(--text-muted);
}

/* Back Button */
.back-btn {
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    z-index: 10;
    cursor: pointer;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header-title {
    font-size: 1.2rem;
    font-weight: 700;
}

.section-header-action {
    color: var(--accent-color);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}


/* Titanium Premium Feed System v4.8.5 */
.scroll-block-container {
    padding: 12px 0;
    margin-bottom: 15px;
}

.section-title {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 0 20px;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.section-title i {
    font-size: 1.2rem;
}

/* Section Accent Colors */
.section-title-blue { color: var(--c-blue); }
.section-title-red { color: var(--c-red); }
.section-title-orange { color: var(--c-orange); }
.section-title-pink { color: var(--c-pink); }
.section-title-green { color: var(--c-green); }

.scroll-horizontal {
    display: flex;
    overflow-x: auto;
    gap: 16px;
    padding: 5px 20px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.scroll-horizontal::-webkit-scrollbar {
    display: none;
}

/* PREMIUM ADAPTIVE CARD (The White Box Style) */
.feed-card-horizontal.premium-style {
    background: #ffffff !important;
    border-radius: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    min-width: 200px;
    width: 200px;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(0,0,0,0.03);
    scroll-snap-align: start;
}

/* DARK MODE OVERRIDE FOR PREMIUM CARD */
[data-theme="dark"] .feed-card-horizontal.premium-style {
    background: #1c1c1e !important;
    border-color: rgba(255,255,255,0.1);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.feed-card-horizontal.premium-style .feed-content h3 {
    color: #000000;
    font-weight: 600;
    margin-bottom: 4px;
}

[data-theme="dark"] .feed-card-horizontal.premium-style .feed-content h3 {
    color: #ffffff;
}

/* FALLBACK ICON LOGIC (Anti-Black Hole) */
.feed-image.fallback-gradient {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: rgba(255,255,255,0.9);
}

[data-theme="light"] .feed-image.fallback-gradient {
    color: rgba(0,0,0,0.5); /* Semi-transparent black for light mode fallbacks */
}

.fallback-blue { background: linear-gradient(135deg, #007aff, #00c7ff) !important; }
.fallback-red { background: linear-gradient(135deg, #ff3b30, #ff9500) !important; }
.fallback-orange { background: linear-gradient(135deg, #ff9500, #ffcc00) !important; }
.fallback-pink { background: linear-gradient(135deg, #ff2d55, #af52de) !important; }
.fallback-green { background: linear-gradient(135deg, #34c759, #007aff) !important; }

/* MAGAZINE v2.1 (The High-Fidelity Look) */
.card-magazine {
    position: relative;
    min-width: 260px;
    height: 180px;
    border-radius: 24px;
    overflow: hidden;
    scroll-snap-align: start;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.card-magazine-img {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.4s ease;
}

.card-magazine-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.card-magazine-title {
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.25;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    margin: 0;
}

/* BADGES (Transplanted from Adaptive) */
.badge-premium {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(5px);
    color: #000;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

[data-theme="dark"] .badge-premium {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.1);
}

/* Standard Feed Card Adjustments */
.feed-card-horizontal {
    flex: 0 0 160px; /* Smaller standard cards for non-magazine blocks */
    scroll-snap-align: start;
}

/* FIX: Category Icons Visibility in Light Mode (v1.63) */
[data-theme="light"] .story-circle { background: #ffffff !important; border-color: #f2f2f7 !important; }
[data-theme="light"] .story-circle.gradient-blue i { color: #007aff !important; }
[data-theme="light"] .story-circle.gradient-red i { color: #ff3b30 !important; }
[data-theme="light"] .story-circle.gradient-orange i { color: #e67e22 !important; } /* Darker Orange */
[data-theme="light"] .story-circle.gradient-purple i { color: #af52de !important; }
[data-theme="light"] .story-circle.gradient-green i { color: #2ea44f !important; } /* Darker Green */
[data-theme="light"] .story-circle.gradient-pink i { color: #ff2d55 !important; }
[data-theme="light"] .story-circle.gradient-cyan i { color: #00a8cc !important; } /* Darker Cyan */
[data-theme="light"] .story-circle.gradient-gray i { color: #555555 !important; } /* Darker Gray */

/* RuDates Tinder-Style UI (v1.61) */
.dating-promo-box {
    background: #facd01;
    margin: 12px;
    padding: 16px;
    border-radius: 24px;
    color: #000;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(250, 205, 1, 0.2);
}
.dating-promo-badge {
    background: #000;
    color: #facd01;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 12px;
}
.dating-promo-title { font-size: 1.8rem; font-weight: 900; margin: 0 0 4px 0; letter-spacing: -0.5px; }
.dating-promo-subtitle { font-size: 0.95rem; opacity: 0.8; margin-bottom: 12px; font-weight: 500; }
.dating-actions { display: flex; gap: 10px; }
.btn-dating {
    padding: 9px 20px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s;
}
.btn-dating:active { transform: scale(0.95); }
.btn-dating-primary { background: #000; color: #fff; }
.btn-dating-secondary { border: 1.5px solid #000; color: #000; }

.card-dating {
    flex: 0 0 160px;
    height: 220px;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    scroll-snap-align: start;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.card-dating-img {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}
.card-dating-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
    color: #fff;
}
.card-dating-name { font-weight: 700; font-size: 1rem; margin-bottom: 2px; }
.card-dating-meta { font-size: 0.75rem; opacity: 0.9; display: flex; align-items: center; gap: 4px; }

/* RuHomes Black Edition UI (v1.62) */
.homes-promo-box {
    background: #000;
    margin: 12px;
    padding: 16px;
    border-radius: 24px;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}
.homes-promo-badge {
    background: #ff3b30;
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 12px;
}
.homes-promo-title { font-size: 1.8rem; font-weight: 900; margin: 0 0 4px 0; letter-spacing: -0.5px; }
.homes-promo-subtitle { font-size: 0.95rem; opacity: 0.7; margin-bottom: 12px; font-weight: 500; }
.homes-actions { display: flex; gap: 10px; }
.btn-homes {
    padding: 9px 24px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    background: #fff;
    color: #000;
    transition: transform 0.2s;
}
.btn-homes:active { transform: scale(0.95); }

.badge-new-green {
    background: #e1f5e8;
    color: #34c759;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    display: inline-block;
    vertical-align: middle;
    margin-left: 6px;
}
.card-homes-location {
    font-size: 0.8rem;
    color: #8e8e93;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.card-homes-price {
    font-size: 0.85rem;
    color: #8e8e93;
    margin-top: 2px;
}

/* RuAfisha Magazine UI (v1.64) */
.afisha-promo-box {
    background: linear-gradient(135deg, #FF2D55, #AF52DE);
    margin: 12px;
    padding: 16px;
    border-radius: 24px;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(255, 45, 85, 0.25);
}
.afisha-promo-badge {
    background: #fff;
    color: #FF2D55;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 12px;
}
.afisha-promo-title { font-size: 1.85rem; font-weight: 900; margin: 0 0 4px 0; letter-spacing: -0.5px; }
.afisha-promo-subtitle { font-size: 0.95rem; opacity: 0.9; margin-bottom: 12px; font-weight: 500; }
.afisha-actions { display: flex; gap: 10px; }

.btn-afisha {
    padding: 9px 20px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s, background 0.2s;
    background: #fff;
    color: #FF2D55;
}
.btn-afisha-outline {
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    color: #fff;
}
.btn-afisha:active { transform: scale(0.95); }

.card-afisha {
    flex: 0 0 160px;
    height: 240px;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    scroll-snap-align: start;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}
.card-afisha-img {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.4s ease;
}
.card-afisha-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
    color: #fff;
}
.card-afisha-title {
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1.15;
    margin-bottom: 0;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* RuJobs Business UI (v1.68) */
.jobs-promo-box {
    background: linear-gradient(135deg, #007AFF, #00C7FF);
    margin: 12px;
    padding: 16px;
    border-radius: 24px;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 122, 255, 0.25);
}
.jobs-promo-badge {
    background: #fff;
    color: #007AFF;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 12px;
}
.jobs-promo-title { font-size: 1.85rem; font-weight: 900; margin: 0 0 4px 0; letter-spacing: -0.5px; }
.jobs-promo-subtitle { font-size: 0.95rem; opacity: 0.9; margin-bottom: 12px; font-weight: 500; }
.jobs-actions { display: flex; gap: 10px; }
.btn-jobs {
    padding: 9px 20px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s;
    background: #fff;
    color: #007AFF;
}
.btn-jobs-outline {
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    color: #fff;
}
.btn-jobs:active { transform: scale(0.95); }

/* RuInfo Knowledge UI (v1.68) */
.info-promo-box {
    background: linear-gradient(135deg, #34C759, #30D158);
    margin: 12px;
    padding: 16px;
    border-radius: 24px;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(52, 199, 89, 0.25);
}
.info-promo-badge {
    background: #fff;
    color: #34C759;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 12px;
}
.info-promo-title { font-size: 1.85rem; font-weight: 900; margin: 0 0 4px 0; letter-spacing: -0.5px; }
.info-promo-subtitle { font-size: 0.95rem; opacity: 0.9; margin-bottom: 12px; font-weight: 500; }
.info-actions { display: flex; gap: 10px; }
.btn-info {
    padding: 9px 20px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s;
    background: #fff;
    color: #34C759;
}
.btn-info-outline {
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    color: #fff;
}
.btn-info:active { transform: scale(0.95); }

/* Unified Premium Card Fallback (v1.68 Upgrade) */
.feed-image.fallback-gradient {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    position: relative;
}
.feed-image.fallback-gradient i {
    font-size: 1.6rem !important; /* Smaller, more elegant */
    opacity: 0.4;
    background: rgba(255,255,255,0.2);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff !important;
}

[data-theme="light"] .feed-image.fallback-gradient i {
    background: rgba(0,0,0,0.05);
    color: rgba(0,0,0,0.3) !important;
}

.fallback-blue { background: linear-gradient(135deg, #E3F2FD, #BBDEFB) !important; }
.fallback-green { background: linear-gradient(135deg, #E8F5E9, #C8E6C9) !important; }
.fallback-orange { background: linear-gradient(135deg, #FFF3E0, #FFE0B2) !important; }

[data-theme="dark"] .fallback-blue { background: linear-gradient(135deg, #0D47A1, #1976D2) !important; opacity: 0.6; }
[data-theme="dark"] .fallback-green { background: linear-gradient(135deg, #1B5E20, #388E3C) !important; opacity: 0.6; }
[data-theme="dark"] .fallback-orange { background: linear-gradient(135deg, #E65100, #FB8C00) !important; opacity: 0.6; }