/**
 * Trending Hashtags Styles
 * Location: /var/www/saafee/public/css/trending.css
 *
 * Layout, platform tabs, inline country dropdown, premium gate, footer info.
 * Card styles come from hashtag-card.css (shared component).
 * Colors: Primary #E44335, Secondary #7A7A7A, Premium Gold #D4A017/#F2C94C
 */

/* ────── Layout ────── */
.trending-main {
    flex: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 16px 40px;
    width: 100%;
}


/* ────── Inline Country Dropdown ────── */
.country-inline-dropdown {
    display: inline-block;
    border: none;
    border-bottom: 2px dashed #E44335;
    background: transparent;
    color: #E44335;
    font-size: inherit;
    font-weight: inherit;
    font-family: inherit;
    padding: 0 4px 2px;
    margin: 0 2px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    outline: none;
    max-width: 200px;
    text-overflow: ellipsis;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23E44335' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
    padding-right: 18px;
}

html[dir="rtl"] .country-inline-dropdown {
    background-position: left 0 center;
    padding-right: 4px;
    padding-left: 18px;
}

.country-inline-dropdown:focus {
    border-bottom-style: solid;
}

.country-inline-dropdown option {
    font-size: 0.85em;
    color: #333;
}

/* ────── Platform Tabs ────── */
.platform-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #E0E0E0;
    margin-bottom: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.platform-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    background: none;
    color: #7A7A7A;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    min-height: 44px;
    transition: color 0.2s, border-color 0.2s;
}

.platform-tab:hover {
    color: #333;
}

.platform-tab.active {
    color: #E44335;
    border-bottom-color: #E44335;
}

.platform-tab .platform-icon {
    flex-shrink: 0;
}

.platform-tab.active .platform-icon {
    color: #E44335;
}

/* ────── Loading ────── */
.trending-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #7A7A7A;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #E0E0E0;
    border-top-color: #E44335;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

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

/* ────── Blurred cards (Premium Gate) ────── */
.hashtag-card.blurred {
    filter: blur(6px);
    pointer-events: none;
    user-select: none;
}

.premium-gate {
    position: relative;
    margin-top: -60px;
    padding-top: 40px;
    background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,0.95) 30%, white 100%);
    text-align: center;
    z-index: 2;
}

.premium-gate-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.premium-gate-content h3 {
    font-size: 1.1em;
    color: #333;
    margin: 0;
}

.premium-gate-content p {
    color: #7A7A7A;
    font-size: 0.9em;
    margin: 0;
}

.premium-cta-btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 28px;
    background: linear-gradient(135deg, #D4A017 0%, #F2C94C 100%);
    color: white;
    font-weight: 700;
    font-size: 0.95em;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    margin-top: 8px;
    min-height: 44px;
    transition: box-shadow 0.2s;
}

.premium-cta-btn:hover {
    box-shadow: 0 4px 16px rgba(212, 160, 23, 0.4);
}

/* ────── Footer Info ────── */
.trending-footer-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 0;
    border-top: 1px solid #E0E0E0;
    margin-top: 16px;
    font-size: 0.8em;
    color: #7A7A7A;
}

.trending-source-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: 500;
}

.trending-source-badge.source-api {
    background: #EBF5FF;
    color: #2F80ED;
}

.trending-source-badge.source-ai {
    background: #FFF8E7;
    color: #D4A017;
}

.trending-stale-badge {
    background: #FFF3E0;
    color: #F2994A;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

/* ────── Empty state ────── */
.trending-empty {
    text-align: center;
    padding: 40px 20px;
    color: #7A7A7A;
}

/* ────── RTL Support ────── */
html[dir="rtl"] .platform-tabs {
    flex-direction: row-reverse;
}

/* ────── Responsive ────── */
@media (min-width: 480px) {
    .country-inline-dropdown {
        max-width: 240px;
    }
}

@media (min-width: 768px) {
    .trending-main {
        padding: 0 20px 60px;
    }

    .platform-tab {
        padding: 12px 24px;
        font-size: 0.95em;
    }

    .country-inline-dropdown {
        max-width: 280px;
    }
}
