/* ===================================
   ORACNOOS - Trending & Popular
   Modern trending section + popular widget
   =================================== */

/* ===================================
   TRENDING SECTION (Homepage)
   =================================== */

.trending-section {
    margin: var(--spacing-3xl) 0;
    padding: var(--spacing-2xl) 0;
    background: linear-gradient(
        135deg,
        rgba(255, 64, 129, 0.05) 0%,
        rgba(0, 229, 255, 0.05) 100%
    );
    border-top: 1px solid rgba(255, 64, 129, 0.2);
    border-bottom: 1px solid rgba(255, 64, 129, 0.2);
    position: relative;
    overflow: hidden;
}

.trending-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-pink);
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% {
        opacity: 0.5;
        box-shadow: 0 0 10px rgba(255, 64, 129, 0.5);
    }
    50% {
        opacity: 1;
        box-shadow: 0 0 20px rgba(255, 64, 129, 0.8);
    }
}

/* ===================================
   Header
   =================================== */

.trending-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.trending-header h2 {
    font-family: var(--font-heading);
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-color);
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
}

.fire-icon {
    font-size: var(--font-size-2xl);
    animation: fireFlicker 1.5s ease-in-out infinite;
}

@keyframes fireFlicker {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        filter: brightness(1);
    }
    25% {
        transform: scale(1.1) rotate(-5deg);
        filter: brightness(1.2);
    }
    50% {
        transform: scale(0.95) rotate(5deg);
        filter: brightness(0.9);
    }
    75% {
        transform: scale(1.05) rotate(-3deg);
        filter: brightness(1.1);
    }
}

.trending-header p {
    color: var(--text-secondary);
    font-size: var(--font-size-base);
}

/* ===================================
   Grid
   =================================== */

.trending-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-xl);
}

/* First card (featured) - spans 2 columns */
.trending-card:nth-child(1) {
    grid-column: span 2;
}

/* Second card (featured) - spans full height on right */
.trending-card:nth-child(2) {
    grid-row: span 2;
}

/* ===================================
   Card
   =================================== */

.trending-card {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid rgba(255, 64, 129, 0.2);
    transition: all var(--transition-bounce);
    position: relative;
}

.trending-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-pink);
    opacity: 0;
    transition: opacity var(--transition-base);
    z-index: 0;
    pointer-events: none;
}

.trending-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-glow-hover);
    border-color: rgba(255, 64, 129, 0.5);
}

.trending-card:hover::before {
    opacity: 0.05;
}

/* Hot card (top 3) */
.trending-card.trending-hot {
    border-color: rgba(255, 64, 129, 0.4);
    box-shadow: 0 8px 32px rgba(255, 64, 129, 0.2);
}

.trending-card.trending-hot::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-pink);
    animation: glowPulse 2s ease-in-out infinite;
}

.trending-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
    position: relative;
    z-index: 1;
}

/* ===================================
   Rank Badge
   =================================== */

.trending-rank {
    position: absolute;
    top: var(--spacing-md);
    left: var(--spacing-md);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.rank-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-pink);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    box-shadow: var(--shadow-md);
}

.hot-badge {
    padding: 0.3rem 0.8rem;
    background: rgba(255, 64, 129, 0.9);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-full);
    color: white;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: pulseBadge 2s ease-in-out infinite;
}

@keyframes pulseBadge {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(255, 64, 129, 0.5);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 20px rgba(255, 64, 129, 0.8);
    }
}

/* ===================================
   Image
   =================================== */

.trending-card-image {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    background: linear-gradient(
        135deg,
        rgba(255, 64, 129, 0.1) 0%,
        rgba(0, 229, 255, 0.1) 100%
    );
}

/* Featured cards (1st and 2nd) taller */
.trending-card:nth-child(1) .trending-card-image,
.trending-card:nth-child(2) .trending-card-image {
    height: 350px;
}

.trending-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.trending-card:hover .trending-card-image img {
    transform: scale(1.1) rotate(2deg);
}

.trending-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(0, 0, 0, 0.4) 100%
    );
    opacity: 0;
    transition: opacity var(--transition-base);
}

.trending-card:hover .trending-overlay {
    opacity: 1;
}

/* ===================================
   Trend Indicator
   =================================== */

.trend-indicator {
    position: absolute;
    bottom: var(--spacing-md);
    right: var(--spacing-md);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    box-shadow: var(--shadow-md);
}

.trend-indicator.trend-up {
    color: #00e676;
    animation: trendUp 1s ease-in-out infinite;
}

.trend-indicator.trend-stable {
    color: #ffa500;
}

.trend-indicator.trend-new {
    color: #00e5ff;
    animation: sparkle 1.5s ease-in-out infinite;
}

@keyframes trendUp {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

@keyframes sparkle {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.2) rotate(180deg);
        filter: brightness(1.5);
    }
}

/* ===================================
   Content
   =================================== */

.trending-card-content {
    padding: var(--spacing-lg);
}

.trending-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.trending-category {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 0.3rem 0.8rem;
    background: rgba(255, 64, 129, 0.1);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--accent-pink);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.trending-views {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    font-weight: var(--font-weight-semibold);
}

.trending-title {
    font-family: var(--font-heading);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--text-color);
    line-height: 1.4;
    margin-bottom: var(--spacing-sm);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color var(--transition-base);
}

/* Featured cards larger title */
.trending-card:nth-child(1) .trending-title,
.trending-card:nth-child(2) .trending-title {
    font-size: var(--font-size-xl);
    -webkit-line-clamp: 3;
}

.trending-card:hover .trending-title {
    color: var(--accent-pink);
}

.trending-excerpt {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===================================
   Footer
   =================================== */

.trending-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(255, 64, 129, 0.1);
}

.trending-reading-time {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

.trending-read-more {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--accent-pink);
    transition: all var(--transition-base);
}

.trending-read-more i {
    transition: transform var(--transition-base);
}

.trending-card:hover .trending-read-more i {
    transform: translateX(5px);
}

/* ===================================
   POPULAR WIDGET (Sidebar)
   =================================== */

.popular-widget {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    border: 1px solid rgba(0, 229, 255, 0.15);
    margin-bottom: var(--spacing-xl);
}

.popular-widget-header {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid rgba(0, 229, 255, 0.2);
}

.popular-widget-header h3 {
    font-family: var(--font-heading);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.popular-widget-header h3 i {
    color: var(--accent-pink);
    animation: fireFlicker 1.5s ease-in-out infinite;
}

.popular-widget-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* ===================================
   Popular Item
   =================================== */

.popular-item {
    position: relative;
    transition: all var(--transition-base);
}

.popular-item::after {
    content: '';
    position: absolute;
    bottom: calc(-1 * var(--spacing-md) / 2);
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(0, 229, 255, 0.1);
}

.popular-item:last-child::after {
    display: none;
}

.popular-item-link {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    text-decoration: none;
    color: inherit;
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.popular-item-link:hover {
    background: rgba(0, 229, 255, 0.05);
}

.popular-item-rank {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    box-shadow: var(--shadow-sm);
}

.popular-item[data-rank="1"] .popular-item-rank {
    background: var(--gradient-pink);
    animation: pulseBadge 2s ease-in-out infinite;
}

.popular-item-image {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: linear-gradient(
        135deg,
        rgba(0, 229, 255, 0.1) 0%,
        rgba(255, 64, 129, 0.1) 100%
    );
}

.popular-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-base);
}

.popular-item-link:hover .popular-item-image img {
    transform: scale(1.1);
}

.popular-item-content {
    flex: 1;
    min-width: 0;
}

.popular-item-title {
    font-family: var(--font-heading);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--text-color);
    line-height: 1.4;
    margin-bottom: var(--spacing-xs);
    transition: color var(--transition-base);
}

.popular-item-link:hover .popular-item-title {
    color: var(--primary-color);
}

.popular-item-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

.popular-views,
.popular-reading-time {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
}

/* ===================================
   Animations
   =================================== */

.trending-card {
    animation: fadeInUp 0.6s ease-out backwards;
}

.trending-card:nth-child(1) {
    animation-delay: 0.1s;
}

.trending-card:nth-child(2) {
    animation-delay: 0.2s;
}

.trending-card:nth-child(3) {
    animation-delay: 0.3s;
}

.trending-card:nth-child(4) {
    animation-delay: 0.4s;
}

.trending-card:nth-child(5) {
    animation-delay: 0.5s;
}

.trending-card:nth-child(6) {
    animation-delay: 0.6s;
}

.popular-item {
    animation: fadeIn 0.5s ease-out backwards;
}

.popular-item:nth-child(1) {
    animation-delay: 0.1s;
}

.popular-item:nth-child(2) {
    animation-delay: 0.2s;
}

.popular-item:nth-child(3) {
    animation-delay: 0.3s;
}

.popular-item:nth-child(4) {
    animation-delay: 0.4s;
}

.popular-item:nth-child(5) {
    animation-delay: 0.5s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ===================================
   Responsive
   =================================== */

@media (max-width: 1024px) {
    .trending-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .trending-card:nth-child(1) {
        grid-column: span 2;
    }
    
    .trending-card:nth-child(2) {
        grid-row: span 1;
    }
}

@media (max-width: 768px) {
    .trending-section {
        margin: var(--spacing-2xl) 0;
        padding: var(--spacing-xl) 0;
    }
    
    .trending-header h2 {
        font-size: var(--font-size-2xl);
    }
    
    .trending-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .trending-card:nth-child(1),
    .trending-card:nth-child(2) {
        grid-column: span 1;
        grid-row: span 1;
    }
    
    .trending-card-image,
    .trending-card:nth-child(1) .trending-card-image,
    .trending-card:nth-child(2) .trending-card-image {
        height: 200px;
    }
    
    .trending-card-content {
        padding: var(--spacing-md);
    }
    
    .popular-widget {
        padding: var(--spacing-md);
    }
    
    .popular-item-image {
        width: 60px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .trending-header h2 {
        font-size: var(--font-size-xl);
        flex-direction: column;
        gap: var(--spacing-xs);
    }
    
    .trending-meta {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .popular-item-link {
        flex-direction: column;
    }
    
    .popular-item-image {
        width: 100%;
        height: 120px;
    }
}

/* ===================================
   Dark Mode
   =================================== */

[data-theme="dark"] .trending-card,
[data-theme="dark"] .popular-widget {
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .trending-card:hover,
[data-theme="dark"] .popular-widget {
    background: rgba(255, 255, 255, 0.05);
}

/* ===================================
   Print
   =================================== */

@media print {
    .trending-section,
    .popular-widget {
        display: none;
    }
}

