/* ========================================
   ТОП-10 Магазинов Постельного Белья - Стили
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Montserrat:wght@300;400;500;600&display=swap');

* {
    box-sizing: border-box;
}

.tbs-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
    font-family: 'Montserrat', sans-serif;
}

/* ========================================
   Заголовок
   ======================================== */

.tbs-header {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
    animation: fadeInDown 1s ease-out;
}

.tbs-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.8rem;
    font-weight: 700;
    margin: 0 0 15px 0;
    background: linear-gradient(135deg, #d4af37 0%, #f9f295 25%, #d4af37 50%, #aa771c 75%, #f9f295 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 4s ease infinite;
    position: relative;
    display: inline-block;
}

.tbs-crown {
    font-size: 2.5rem;
    animation: bounce 2s ease-in-out infinite;
    display: inline-block;
    margin: 0 15px;
}

.tbs-subtitle {
    font-size: 1.1rem;
    color: #666;
    font-weight: 300;
    margin: 10px 0 0 0;
    letter-spacing: 0.5px;
}

/* ========================================
   Список магазинов
   ======================================== */

.tbs-list {
    display: grid;
    gap: 25px;
}

.tbs-item {
    position: relative;
    animation: fadeInUp 0.6s ease-out backwards;
    animation-delay: calc(var(--item-index, 0) * 0.1s);
}

.tbs-item[data-rank="1"] { --item-index: 0; }
.tbs-item[data-rank="2"] { --item-index: 1; }
.tbs-item[data-rank="3"] { --item-index: 2; }
.tbs-item[data-rank="4"] { --item-index: 3; }
.tbs-item[data-rank="5"] { --item-index: 4; }
.tbs-item[data-rank="6"] { --item-index: 5; }
.tbs-item[data-rank="7"] { --item-index: 6; }
.tbs-item[data-rank="8"] { --item-index: 7; }
.tbs-item[data-rank="9"] { --item-index: 8; }
.tbs-item[data-rank="10"] { --item-index: 9; }

.tbs-item-inner {
    background: #fff;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(212, 175, 55, 0.15);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    display: flex;
    gap: 25px;
    align-items: flex-start;
}

.tbs-item-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #d4af37, #f9f295, #d4af37, #aa771c);
    background-size: 400% 400%;
    opacity: 0;
    transition: opacity 0.4s ease;
    animation: gradientShift 3s ease infinite;
    z-index: 0;
}

.tbs-item:hover .tbs-item-inner::before {
    opacity: 0.1;
}

.tbs-item:hover .tbs-item-inner {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(212, 175, 55, 0.3);
    border-color: #d4af37;
}

/* Особое выделение для первого места */
.tbs-item[data-rank="1"] .tbs-item-inner {
    background: linear-gradient(135deg, #fffef7 0%, #fff9e6 100%);
    border: 3px solid #d4af37;
    box-shadow: 0 15px 50px rgba(212, 175, 55, 0.25);
}

.tbs-item[data-rank="1"] .tbs-item-inner::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #d4af37, #f9f295, #d4af37, #aa771c);
    background-size: 400% 400%;
    border-radius: 20px;
    z-index: -1;
    animation: gradientShift 3s ease infinite;
}

/* ========================================
   Ранг
   ======================================== */

.tbs-rank-badge {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #d4af37 0%, #f9f295 50%, #d4af37 100%);
    background-size: 200% 200%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
    position: relative;
    z-index: 1;
    animation: gradientShift 4s ease infinite, pulse 2s ease-in-out infinite;
}

.tbs-rank-badge::before {
    content: '';
    position: absolute;
    inset: 3px;
    background: #fff;
    border-radius: 50%;
    z-index: -1;
}

.tbs-rank-number {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #d4af37, #aa771c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Особый стиль для первого места */
.tbs-item[data-rank="1"] .tbs-rank-badge {
    width: 80px;
    height: 80px;
    animation: gradientShift 4s ease infinite, pulse 2s ease-in-out infinite, rotate 10s linear infinite;
}

/* ========================================
   Контент
   ======================================== */

.tbs-content {
    flex: 1;
    position: relative;
    z-index: 1;
}

.tbs-badge {
    display: inline-block;
    background: linear-gradient(135deg, #d4af37, #f9f295);
    color: #333;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 12px;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    animation: shimmer 2s ease-in-out infinite;
}

.tbs-store-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.tbs-store-name a {
    color: #222;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
}

.tbs-store-name a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #d4af37, #f9f295);
    transition: width 0.4s ease;
}

.tbs-store-name a:hover {
    background: linear-gradient(135deg, #d4af37, #f9f295);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tbs-store-name a:hover::after {
    width: 100%;
}

.tbs-description {
    color: #666;
    font-size: 1rem;
    line-height: 1.6;
    margin: 0 0 20px 0;
    font-weight: 400;
}

/* ========================================
   Футер карточки
   ======================================== */

.tbs-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.tbs-rating {
    display: flex;
    align-items: center;
    gap: 5px;
}

.tbs-star {
    color: #d4af37;
    font-size: 1.2rem;
    animation: starTwinkle 2s ease-in-out infinite;
    display: inline-block;
}

.tbs-star:nth-child(1) { animation-delay: 0s; }
.tbs-star:nth-child(2) { animation-delay: 0.2s; }
.tbs-star:nth-child(3) { animation-delay: 0.4s; }
.tbs-star:nth-child(4) { animation-delay: 0.6s; }
.tbs-star:nth-child(5) { animation-delay: 0.8s; }

.tbs-rating-number {
    font-weight: 600;
    color: #333;
    margin-left: 5px;
    font-size: 1.1rem;
}

.tbs-visit-btn {
    background: linear-gradient(135deg, #d4af37 0%, #f9f295 50%, #d4af37 100%);
    background-size: 200% 200%;
    color: #333;
    padding: 12px 28px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(212, 175, 55, 0.3);
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.tbs-visit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    transition: left 0.5s ease;
}

.tbs-visit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(212, 175, 55, 0.5);
    animation: gradientShift 2s ease infinite;
}

.tbs-visit-btn:hover::before {
    left: 100%;
}

/* ========================================
   Анимации
   ======================================== */

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

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

@keyframes shimmer {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

@keyframes starTwinkle {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.6; 
        transform: scale(0.9);
    }
}

/* ========================================
   Адаптивность
   ======================================== */

@media (max-width: 768px) {
    .tbs-title {
        font-size: 2rem;
    }
    
    .tbs-crown {
        font-size: 1.8rem;
        margin: 0 10px;
    }
    
    .tbs-subtitle {
        font-size: 1rem;
    }
    
    .tbs-item-inner {
        flex-direction: column;
        padding: 25px 20px;
    }
    
    .tbs-rank-badge {
        width: 60px;
        height: 60px;
        align-self: center;
    }
    
    .tbs-item[data-rank="1"] .tbs-rank-badge {
        width: 70px;
        height: 70px;
    }
    
    .tbs-rank-number {
        font-size: 1.6rem;
    }
    
    .tbs-store-name {
        font-size: 1.5rem;
        text-align: center;
    }
    
    .tbs-description {
        text-align: center;
    }
    
    .tbs-footer {
        flex-direction: column;
        gap: 15px;
    }
    
    .tbs-visit-btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .tbs-container {
        padding: 15px;
    }
    
    .tbs-title {
        font-size: 1.6rem;
    }
    
    .tbs-item-inner {
        padding: 20px 15px;
    }
}

/* ========================================
   Печать
   ======================================== */

@media print {
    .tbs-item-inner {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .tbs-visit-btn {
        display: none;
    }
}
