/* Hero Slider Styles */
.slider-container {
    position: relative;
    overflow: hidden;
    border-radius: 0.75rem;
    height: 400px;
}

.slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    background-size: cover;
    background-position: center;
}

.slide.active {
    opacity: 1;
}

.slider-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background 0.3s;
}

.slider-dot.active {
    background: white;
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.3);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    z-index: 10;
    transition: background 0.3s;
}

.slider-arrow:hover {
    background: rgba(0,0,0,0.6);
}

.slider-arrow.prev { left: 20px; }
.slider-arrow.next { right: 20px; }

/* Chat Styles */
.chat-container {
    position: sticky;
    top: 20px;
    height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
}

#chatMessages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-message {
    max-width: 85%;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-input-area {
    padding: 15px;
    border-top: 1px solid #e5e7eb;
    background: white;
    border-bottom-left-radius: 0.75rem;
    border-bottom-right-radius: 0.75rem;
}

#chatInput {
    resize: none;
    min-height: 50px;
}

/* Forum Card Styles */
.forum-card {
    transition: all 0.3s ease;
}

.forum-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

/* News Card Styles */
.news-card {
    transition: all 0.3s ease;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Navbar Styles */
.navbar {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

/* Instagram Embed Styles */
.instagram-embed {
    border-radius: 0.75rem;
    overflow: hidden;
    height: 400px;
}

/* Verification Form Styles */
.verification-form {
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Online Users Badge */
.online-badge {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Chat Styles - GROUP/FORUM VERSION */
#chatMessages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: linear-gradient(to bottom, #f8fafc, #f1f5f9);
}

.chat-message {
    width: 100%;
    animation: fadeIn 0.3s ease;
}

/* Semua pesan dari orang lain - rata kiri */
.chat-message .bg-white {
    max-width: 75%;
    border: 1px solid #e2e8f0;
    margin-right: auto;
}

/* Pesan sendiri - rata kanan */
.chat-message .bg-blue-600 {
    margin-left: auto;
    max-width: 75%;
}

/* Avatar dengan warna berbeda-beda */
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

.avatar-1 { background: #3b82f6; }
.avatar-2 { background: #10b981; }
.avatar-3 { background: #f59e0b; }
.avatar-4 { background: #ef4444; }
.avatar-5 { background: #8b5cf6; }
.avatar-6 { background: #ec4899; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-time {
    text-align: right;
    font-size: 10px;
    margin-top: 4px;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}

/* GROUP CHAT / FORUM STYLES - WAJIB TAMBAHKAN INI */
#chatMessages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: linear-gradient(to bottom, #f8fafc, #f1f5f9);
}

.chat-message {
    width: 100%;
    animation: fadeIn 0.3s ease;
}

/* SEMUA PESAN ORANG LAIN - RATA KIRI, BISA SEMUA NIS */
.chat-message .bg-white {
    max-width: 75%;
    border: 1px solid #e2e8f0;
    margin-right: auto; /* SELALU DI KIRI! */
}

/* HANYA PESAN SENDIRI - RATA KANAN */
.chat-message .bg-blue-600 {
    margin-left: auto; /* HANYA PESANMU YANG DI KANAN */
    max-width: 75%;
}

/* Avatar warna berbeda untuk setiap user */
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

.avatar-1 { background: #3b82f6; } /* Biru */
.avatar-2 { background: #10b981; } /* Hijau */
.avatar-3 { background: #f59e0b; } /* Kuning */
.avatar-4 { background: #ef4444; } /* Merah */
.avatar-5 { background: #8b5cf6; } /* Ungu */
.avatar-6 { background: #ec4899; } /* Pink */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-time {
    text-align: right;
    font-size: 10px;
    margin-top: 4px;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%,100% { opacity: 1; }
    50% { opacity: .5; }
}
/* RESPONSIF HP - TAMPILAN CHAT YANG BAGUS */
@media (max-width: 1024px) {
    /* Chat sidebar full width di HP */
    #chatArea {
        height: 80vh !important;
        width: 100%;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 100;
        border-radius: 16px 16px 0 0;
    }
    
    #chatMessages {
        max-height: calc(100% - 120px);
        padding: 0.75rem;
    }
    
    .chat-message .bg-white, .chat-message .bg-blue-600 {
        max-width: 85% !important;
        font-size: 14px;
    }
    
    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    #chatInput {
        font-size: 14px;
        padding: 0.5rem 1rem;
    }
}

/* Perbaiki padding chat preview di HP */
@media (max-width: 768px) {
    #chatPreview, #nisVerification {
        padding: 1rem;
    }
    
    .forum-card {
        margin-bottom: 0.75rem;
        padding: 0.75rem;
    }
}
/* FIX UNTUK HP - CHAT SELALU MUNCUL */
@media (max-width: 1024px) {
    /* Chat tidak perlu fixed, buat full width di bawah */
    .lg\:col-span-1 {
        width: 100% !important;
        margin-top: 2rem;
    }
    
    #chatArea {
        height: 70vh !important;
        width: 100% !important;
        position: relative !important;
        border-radius: 12px;
        z-index: 10;
    }
    
    /* Semua elemen chat tidak ada yang hidden */
    #chatPreview, #nisVerification, #chatArea {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    #chatMessages {
        padding: 0.75rem;
    }
    
    .chat-message .bg-white, .chat-message .bg-blue-600 {
        max-width: 90% !important;
    }
}
