/* --- RESET & VARIABLES (Sidebar Scope Only) --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-white: #ffffff;
    --text-dark: #111827;
    --text-muted: #6b7280;
    --brand-blue: #0d6efd;
    --brand-blue-hover: #0a58ca;
    --telegram-color: #0088cc;
    --whatsapp-color: #25D366;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    --hover-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* --- SIDEBAR WRAPPER --- */
.sidebar {
    width: 30%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* --- COMMON SIDEBAR CARDS --- */
.sidecard {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.sidecard:hover {
    box-shadow: var(--hover-shadow);
    transform: translateY(-2px);
}

/* Trending Header */
.sidecard-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f3f4f6;
}

.trend-icon {
    width: 22px;
    height: 22px;
    color: #f59e0b; /* Vibrant fire yellow/orange glow */
    flex-shrink: 0;
}

.sidecard-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-dark);
}

/* Trending List Item Styling */
.trend-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.trend-item {
    border-bottom: 1px dashed #e5e7eb;
    padding-bottom: 0.85rem;
}

.trend-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.trend-link {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    text-decoration: none;
    color: #374151;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.45;
    transition: color 0.2s ease, transform 0.2s ease;
}

.trend-link:hover {
    color: var(--brand-blue);
    transform: translateX(4px);
}

.trend-bullet {
    color: var(--brand-blue);
    font-weight: bold;
    font-size: 1.2rem;
    line-height: 1;
}

/* CSS Line-Clamp: Replaces substr() bug safely */
.trend-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.empty-notice {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
    padding: 1rem 0;
}

/* --- SOCIAL MEDIA CARDS (TELEGRAM & WHATSAPP) --- */
.social-card {
    text-align: center;
    padding: 1.75rem 1.5rem;
    border-radius: 14px;
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.social-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

.telegram {
    background: linear-gradient(135deg, var(--telegram-color), #006699);
}

.whatsapp {
    background: linear-gradient(135deg, var(--whatsapp-color), #128c7e);
}

.social-icon-badge {
    width: 52px;
    height: 52px;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.25rem;
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.16);
}

.social-icon-badge svg {
    width: 30px;
    height: 30px;
    stroke-width: 2.4;
}

.telegram .social-icon-badge svg { color: var(--telegram-color); }
.whatsapp .social-icon-badge svg { color: var(--whatsapp-color); }

.social-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
}

.social-card p {
    font-size: 0.9rem;
    line-height: 1.4;
    opacity: 0.92;
    margin-bottom: 0.5rem;
    max-width: 90%;
}

/* Social Buttons */
.social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1.25rem;
    background: #ffffff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.social-btn svg {
    width: 18px;
    height: 18px;
    transition: transform 0.2s ease;
}

.social-btn:hover svg {
    transform: translateX(4px);
}

.tg-btn {
    color: var(--telegram-color);
}

.tg-btn:hover {
    background: #f0f8ff;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.wa-btn {
    color: var(--whatsapp-color);
}

.wa-btn:hover {
    background: #f0fdf4;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}


/* ========================================================
   --- TABLET RESPONSIVE (Max-Width: 1024px) --- 
======================================================== */
@media (max-width: 1024px) {
    .sidebar {
        width: 35%; /* Gives more breathing space to sidebar on medium tablets */
        gap: 1.25rem;
    }

    .sidecard {
        padding: 1.25rem;
    }

    .sidecard-header h3 {
        font-size: 1.1rem;
    }

    .trend-link {
        font-size: 0.9rem;
    }

    .social-card {
        padding: 1.5rem 1.25rem;
    }

    .social-card h3 {
        font-size: 1.15rem;
    }

    .social-card p {
        font-size: 0.85rem;
    }
}


/* ========================================================
   --- MOBILE RESPONSIVE (Max-Width: 540px) --- 
======================================================== */
@media (max-width: 540px) {
    .sidebar {
        width: 100%; /* Stacks naturally below the main content area on phone screens */
        position: static;
        gap: 1.25rem;
        margin-top: 1rem;
    }

    .sidecard {
        padding: 1.25rem 1rem;
        border-radius: 10px;
    }

    .sidecard-header {
        margin-bottom: 1rem;
    }

    .trend-link {
        font-size: 0.92rem;
    }

    /* Make buttons slightly larger and easier to tap on mobile screens */
    .social-btn {
        padding: 0.85rem 1rem;
        font-size: 1rem;
    }

    .social-icon-badge {
        width: 44px;
        height: 44px;
    }

    .social-icon-badge svg {
        width: 24px;
        height: 24px;
    }
}
/* --- FINAL TELEGRAM / WHATSAPP CTA FIX --- */
.social-card .social-btn {
    width: auto;
    min-width: 210px;
    max-width: 92%;
    min-height: 44px;
    padding: 0.72rem 1.15rem;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 10px;
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.social-card .social-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.65);
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.18);
    transform: translateY(-2px);
}

.social-card .social-btn svg {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    display: block;
    color: currentColor;
}

@media (max-width: 540px) {
    .social-card .social-btn {
        width: auto;
        min-width: 210px;
        max-width: 94%;
        padding: 0.78rem 1rem;
    }
}
