/* ======================== [CSS VARIABLES] ======================== */
:root {
    --primary: #d32f2f;
    --dark: #121212;
    --white: #ffffff;
    --text-main: #333;
    --text-light: #555;
    --bg-gray: #f4f6f8;

    /* Status Colors */
    --green: #2e7d32;
    --blue: #1565c0;
    --orange: #ef6c00;
    --purple: #7b1fa2;
    
    --shadow: 0 4px 15px rgba(0,0,0,0.08);
    --shadow-hover: 0 10px 25px rgba(0,0,0,0.15);
}

.container { 
    max-width: 1350px; 
    margin: 0 auto; 
    padding: 0 20px; 
}

/* ======================== [TRENDING GRID STYLES] ======================== */
.trending-section { 
    margin-bottom: 40px; 
    padding: 40px 0;
    background-color: #f4f6f8;
}

/* ==================== DESKTOP: 4 COLUMNS ==================== */
.trending-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 columns on desktop */
    gap: 25px;
    width: 100%;
}

/* ==================== TABLET: 3 COLUMNS ==================== */
@media (max-width: 1200px) {
    .trending-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 columns */
        gap: 20px;
    }
}

/* ==================== MOBILE: 2 COLUMNS ==================== */
@media (max-width: 768px) {
    .trending-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns */
        gap: 15px;
    }

    .trending-section {
        padding: 30px 0;
    }

    .container {
        padding: 0 15px;
    }
}

/* ==================== SMALL MOBILE: 1 COLUMN ==================== */
@media (max-width: 480px) {
    .trending-grid {
        grid-template-columns: 1fr; /* 1 column for very small screens */
        gap: 15px;
    }
}

/* --- [CARD DESIGN] --- */
.trend-card {
    background: var(--white);
    border-radius: 15px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid #eeeeee;
    display: flex;
    flex-direction: column;
    min-height: 160px;
    width: 100%; /* Ensure full width within grid cell */
}

.trend-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: #d32f2f;
}

/* Top Color Bar */
.trend-top-bar {
    height: 5px;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.tb-green { background: var(--green); }
.tb-red { background: var(--primary); }
.tb-blue { background: var(--blue); }
.tb-orange { background: var(--orange); }

/* --- [CONTENT LAYOUT] --- */
.trend-content {
    padding: 25px 20px;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Mobile card padding adjustment */
@media (max-width: 768px) {
    .trend-content {
        padding: 20px 15px;
    }
}

/* Badges Row */
.trend-badge-row {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

/* Badge Styling */
.t-badge {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 50px;
    letter-spacing: 0.5px;
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Mobile badge size */
@media (max-width: 768px) {
    .t-badge {
        font-size: 9px;
        padding: 3px 10px;
    }
}

/* Badge Colors */
.bg-live { background: linear-gradient(135deg, #43a047, #2e7d32); }
.bg-new { background: linear-gradient(135deg, #ff9800, #f57c00); }
.bg-hot { background: linear-gradient(135deg, #e53935, #c62828); animation: pulse-red 1.5s infinite; }
.bg-imp { background: linear-gradient(135deg, #8e24aa, #6a1b9a); }
.bg-merit { background: linear-gradient(135deg, #039be5, #0277bd); }

/* Title */
.trend-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 10px;
    line-height: 1.4;
}

/* Mobile title size */
@media (max-width: 768px) {
    .trend-title {
        font-size: 15px;
        line-height: 1.3;
    }
}

/* --- [FOOTER LAYOUT] --- */
.trend-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    width: 100%;
}

/* Details (Left Side) */
.trend-details {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f8f9fa;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #eee;
}

.trend-details i { color: var(--primary); }

/* Mobile details size */
@media (max-width: 768px) {
    .trend-details {
        font-size: 10px;
        padding: 5px 8px;
        gap: 4px;
    }
}

/* Views (Right Side) */
.trend-views {
    font-size: 12px;
    color: #777;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.9);
    padding: 6px 10px;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.trend-views i { color: #555; }

/* Mobile views size */
@media (max-width: 768px) {
    .trend-views {
        font-size: 10px;
        padding: 5px 8px;
        gap: 4px;
    }
}

/* --- [BACKGROUND ICON ANIMATION] --- */
.trend-bg-icon {
    position: absolute;
    right: -15px;
    bottom: -15px;
    font-size: 90px;
    color: rgba(0,0,0,0.03);
    transform: rotate(-15deg);
    transition: all 0.4s ease;
    z-index: 1;
}

.trend-card:hover .trend-bg-icon {
    transform: rotate(0deg) scale(1.1);
    color: rgba(0,0,0,0.07);
    right: -5px;
    bottom: -5px;
}

/* Mobile background icon size */
@media (max-width: 768px) {
    .trend-bg-icon {
        font-size: 60px;
        right: -10px;
        bottom: -10px;
    }
}

/* Animation Keyframe */
@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(229, 57, 53, 0); }
    100% { box-shadow: 0 0 0 0 rgba(229, 57, 53, 0); }
}