/**
 * BroSisPKU Web Style - Tailwind CSS Additional Styles
 * Custom CSS for animations, gradients, and effects that cannot be easily done with Tailwind utilities
 */

/* ========== CSS VARIABLES ========== */
:root {
    --primary: #E74C3C;
    --primary-dark: #C0392B;
    --header-bg: #2c2c2c;
    --content-bg: #f5f5f5;
    --card-bg: #ffffff;
    --text-dark: #333333;
    --text-light: #ffffff;
    --text-muted: #666666;

    /* Category Colors */
    --kuliner: #42B549;
    --waktu: #17a2b8;
    --bisnis: #FF9800;
    --info: #E74C3C;
    --lokasi: #9C27B0;
    --hiburan: #28a745;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.5s ease forwards;
}

.animate-shimmer {
    animation: shimmer 1.5s infinite;
}

/* Animation delays for cards */
.post-card:nth-child(1) {
    animation-delay: 0.1s;
}

.post-card:nth-child(2) {
    animation-delay: 0.15s;
}

.post-card:nth-child(3) {
    animation-delay: 0.2s;
}

.post-card:nth-child(4) {
    animation-delay: 0.25s;
}

.post-card:nth-child(5) {
    animation-delay: 0.3s;
}

.post-card:nth-child(6) {
    animation-delay: 0.35s;
}

/* ========== GRADIENT BACKGROUNDS ========== */
.bg-gradient-kuliner {
    background: linear-gradient(135deg, #42B549 0%, #2d7d32 100%);
}

.bg-gradient-waktu {
    background: linear-gradient(135deg, #17a2b8 0%, #0d6d7d 100%);
}

.bg-gradient-bisnis {
    background: linear-gradient(135deg, #FF9800 0%, #e65100 100%);
}

.bg-gradient-info {
    background: linear-gradient(135deg, #E74C3C 0%, #c0392b 100%);
}

.bg-gradient-lokasi {
    background: linear-gradient(135deg, #9C27B0 0%, #6a1b9a 100%);
}

/* ========== HEADER BACKGROUND ========== */
.header-bg {
    background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.4)),
        url('/assets/image/banner3.jpg') center/cover no-repeat;
}

/* ========== POST CARD OVERLAY ========== */
.post-overlay {
    background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.7) 100%);
}

/* ========== FILTER BUTTON ACTIVE STATES ========== */
.filter-btn.kuliner.active,
.filter-btn.kuliner:hover {
    background: linear-gradient(135deg, #42B549 0%, #2d7d32 100%);
    border-color: var(--kuliner);
    color: var(--text-light);
}

.filter-btn.waktu.active,
.filter-btn.waktu:hover {
    background: linear-gradient(135deg, #17a2b8 0%, #0d6d7d 100%);
    border-color: var(--waktu);
    color: var(--text-light);
}

.filter-btn.bisnis.active,
.filter-btn.bisnis:hover {
    background: linear-gradient(135deg, #FF9800 0%, #e65100 100%);
    border-color: var(--bisnis);
    color: var(--text-light);
}

.filter-btn.info.active,
.filter-btn.info:hover {
    background: linear-gradient(135deg, #E74C3C 0%, #c0392b 100%);
    border-color: var(--info);
    color: var(--text-light);
}

.filter-btn.lokasi.active,
.filter-btn.lokasi:hover {
    background: linear-gradient(135deg, #9C27B0 0%, #6a1b9a 100%);
    border-color: var(--lokasi);
    color: var(--text-light);
}

/* ========== SORT BUTTON ACTIVE STATE ========== */
.sort-btn.active {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

/* ========== SKELETON LOADING ========== */
.skeleton-card {
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #eee;
}

.skeleton-image {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-content {
    padding: 20px;
}

.skeleton-category {
    width: 80px;
    height: 24px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 15px;
    margin-bottom: 12px;
}

.skeleton-title {
    height: 20px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton-title.short {
    width: 60%;
}

.skeleton-meta {
    display: flex;
    gap: 15px;
    margin-top: 12px;
}

.skeleton-meta-item {
    width: 70px;
    height: 14px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

/* ========== LOADING SPINNER ========== */
.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #eee;
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 0.8s linear infinite;
}

/* ========== BACK TO TOP BUTTON ========== */
.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ========== SEARCH SECTION SCROLLED ========== */
.search-section.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* ========== CLEAR FILTERS BUTTON ========== */
.clear-filters.show {
    display: block;
}

/* ========== POST CARD ANIMATION ========== */
.post-card {
    animation: fadeInUp 0.5s ease forwards;
}

/* ========== HOVER EFFECTS FOR POST STATS ========== */
.post-card:hover .post-stats {
    opacity: 1;
    transform: translateY(0);
}

.post-card:hover .post-overlay {
    opacity: 1;
}

.post-card:hover .post-image {
    transform: scale(1.05);
}

/* ========== PREMIUM LANGUAGE SELECTOR ========== */
.lang-selector-wrapper {
    position: relative;
    user-select: none;
}

/* Current Language Button */
.lang-current-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 18px;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.lang-current-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lang-current-btn.open {
    background: rgba(255, 255, 255, 0.4);
}

.lang-current-btn .lang-code-text {
    font-size: 15px;
    font-weight: 700;
    opacity: 0.95;
    letter-spacing: 0.5px;
}

.lang-current-btn .lang-name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.lang-current-btn .lang-chevron {
    font-size: 11px;
    transition: transform 0.3s ease;
    opacity: 0.8;
}

.lang-current-btn.open .lang-chevron {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.lang-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
    display: none;
    z-index: 1000;
}

.lang-dropdown-menu.open {
    display: block;
    animation: dropdownPopIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes dropdownPopIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Dropdown Items */
.lang-dropdown-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    color: #4a5568;
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
}

.lang-dropdown-item:hover {
    background: #f8fafc;
    color: #E74C3C;
}

.lang-dropdown-item .lang-code-tag {
    font-size: 13px;
    font-weight: 700;
    min-width: 50px;
    display: inline-block;
    color: inherit;
    opacity: 0.8;
}

.lang-dropdown-item .lang-name {
    font-size: 14px;
    flex: 1;
}

.lang-dropdown-item .lang-check {
    font-size: 12px;
}

/* Active Item Styling */
.lang-dropdown-item.active {
    background: #fff5f5;
    /* Light red background */
    color: #E74C3C;
    font-weight: 600;
}

/* Mobile Adjustments */
@media (max-width: 640px) {
    .lang-current-btn .lang-name {
        display: none;
    }
}

/* ========== NEW LANGUAGE SELECTOR (with flags) ========== */
.lang-selector {
    position: relative;
    user-select: none;
}

/* Dropdown for new selector */
.lang-dropdown {
    display: none;
    animation: dropdownPopIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.lang-dropdown.open {
    display: block;
}

/* Ensure chevron rotates smoothly */
.lang-chevron {
    transition: transform 0.3s ease;
}

.gradient-kuliner {
    background: linear-gradient(135deg, #42B549 0%, #2E7D32 100%);
}

.gradient-waktu {
    background: linear-gradient(135deg, #17a2b8 0%, #117a8b 100%);
}

.gradient-bisnis {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
}

.gradient-info {
    background: linear-gradient(135deg, #E74C3C 0%, #C0392B 100%);
}

.gradient-lokasi {
    background: linear-gradient(135deg, #9C27B0 0%, #7B1FA2 100%);
}

.bg-gradient-kuliner {
    background: linear-gradient(135deg, #42B549 0%, #2E7D32 100%);
}

.bg-gradient-waktu {
    background: linear-gradient(135deg, #17a2b8 0%, #117a8b 100%);
}

.bg-gradient-bisnis {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
}

.bg-gradient-info {
    background: linear-gradient(135deg, #E74C3C 0%, #C0392B 100%);
}

.bg-gradient-lokasi {
    background: linear-gradient(135deg, #9C27B0 0%, #7B1FA2 100%);
}

.stat-card {
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px) scale(1.02);
}

.image-container {
    position: relative;
    overflow: hidden;
}

.image-container img {
    transition: transform 0.5s ease;
}

.image-container:hover img {
    transform: scale(1.05);
}

.category-badge {
    transition: all 0.3s ease;
}

.category-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.back-button {
    transition: all 0.3s ease;
}

.back-button:hover {
    transform: translateX(-5px);
}

.engagement-bar {
    height: 8px;
    background: linear-gradient(90deg, #42B549 0%, #17a2b8 50%, #E74C3C 100%);
    border-radius: 999px;
    transition: all 0.5s ease;
}

.pulse-animation {
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}