/*
 * TOON18.PLUS - Main Styles
 * Mobile-First Design (90% mobile traffic)
 */

/* ============================================
   RESET & BASE
   ============================================ */

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

:root {
    /* Цвета */
    --bg-primary: #0A0A0A;
    --bg-secondary: #1A1A1A;
    --bg-card: #1F1F1F;
    --text-primary: #FFFFFF;
    --text-secondary: #B0B0B0;
    --accent-pink: #FF4081;
    --accent-purple: #9C27B0;
    --accent-red: #E91E63;
    
    /* Размеры */
    --header-height: 60px;
    --card-gap: 16px;
    --border-radius: 12px;
    
    /* Тени */
    --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 8px 24px rgba(255, 64, 129, 0.3);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ============================================
   HEADER
   ============================================ */

.header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-pink), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ============================================
   FILTERS (TAGS)
   ============================================ */

.filters {
    position: sticky;
    top: var(--header-height);
    background: var(--bg-secondary);
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 99;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}

.filters::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
}

.filters-container {
    display: flex;
    gap: 8px;
    padding: 0 16px;
    white-space: nowrap;
}

.filter-tag {
    display: inline-block;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.filter-tag:hover,
.filter-tag.active {
    background: var(--accent-pink);
    color: #fff;
    border-color: var(--accent-pink);
    transform: translateY(-2px);
}

/* ============================================
   OFFERS GRID
   ============================================ */

.offers-container {
    padding: 20px 16px 80px;
    max-width: 100%;
    margin: 0 auto;
}

.offers-grid {
    display: flex;
    flex-direction: column;
    gap: var(--card-gap);
}

/* ============================================
   OFFER CARD
   ============================================ */

.offer-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
    position: relative;
}

.offer-card:active {
    transform: scale(0.98);
}

.card-image-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    background: linear-gradient(135deg, #2A2A2A 0%, #1A1A1A 100%);
    overflow: hidden;
}

.card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    cursor: pointer;
}

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

/* Badge (NEW, HOT, TRENDING) */
.card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

.card-badge.hot {
    background: #FF4500; /* Оранжево-красный */
}

.card-badge.new {
    background: #00D9FF; /* Голубой/циановый */
}

.card-badge.trending {
    background: #FFD700; /* Желтый */
    color: #000;
}

/* Adult Badge */
.card-adult-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Loading skeleton */
.card-image-skeleton {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #1A1A1A 0%, #2A2A2A 50%, #1A1A1A 100%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Card Content */
.card-content {
    padding: 16px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

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

.card-views::before {
    content: '👁';
    font-size: 14px;
}

.card-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Expanded состояние */
.card-description.expanded {
    -webkit-line-clamp: unset;
    display: block;
}

/* Индикатор "читать далее" */
.card-description::after {
    content: '... Read more';
    position: absolute;
    bottom: 0;
    right: 0;
    background: linear-gradient(to right, transparent, var(--bg-card) 50%);
    padding-left: 40px;
    color: var(--accent-pink);
    font-weight: 600;
    pointer-events: none;
}

.card-description.expanded::after {
    content: ' ▲ Show less';
    position: static;
    background: none;
    padding-left: 0;
    display: block;
    margin-top: 8px;
    text-align: center;
}

/* Убираем индикатор если текст короткий */
.card-description.short::after {
    display: none;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.card-tag {
    font-size: 11px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--text-secondary);
}

.card-button {
    display: block;
    width: 100%;
    padding: 14px;
    background: var(--accent-pink);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 64, 129, 0.3);
}

.card-button:hover {
    background: #E91E63;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 64, 129, 0.5);
}

.card-button:active {
    transform: translateY(0);
}

/* ============================================
   LOADING INDICATOR
   ============================================ */

.loading-indicator {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-pink);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

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

.empty-state-text {
    font-size: 18px;
    margin-bottom: 8px;
}

/* ============================================
   RESPONSIVE - TABLET & DESKTOP
   ============================================ */

@media (min-width: 768px) {
    :root {
        --card-gap: 20px;
    }
    
    .offers-container {
        padding: 24px 24px 80px;
        max-width: 1200px;
    }
    
    .offers-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
    
    .card-title {
        font-size: 20px;
    }
}

@media (min-width: 1024px) {
    .offers-container {
        padding: 32px 32px 80px;
    }
    
    .offers-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .offer-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-hover);
    }
    
    /* На десктопе: 5 строк, без гармошки */
    .card-description {
        -webkit-line-clamp: 5;
        cursor: default;
    }
    
    .card-description::after {
        display: none;
    }
    
    .card-description.expanded {
        -webkit-line-clamp: 5;
    }
}

@media (min-width: 1440px) {
    .offers-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
