/* ============================================================================ */
/* 🎨 ENHANCED BADGE GALLERY VISUAL SYSTEM - UNIFIED & CLEANED                 */
/* ============================================================================ */

/* ============================================================================ */
/* 📋 GRID LAYOUT SYSTEM - UNIFIED (3x2 Layout for All Badge Grids)           */
/* ============================================================================ */

/* UNIFIED: Single grid layout for all badge containers */
.badge-gallery-grid,
.badge-grid,
#badge-gallery-container .grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
    min-height: 180px;
}

/* ============================================================================ */
/* 🏆 BADGE CARD SYSTEM - UNIFIED (Single Card Style for All Contexts)        */
/* ============================================================================ */

/* UNIFIED: Badge card styling for all contexts (gallery, modal, dashboard) */
.badge-card,
.badge-item,
#badge-gallery-container .grid > div {
    position: relative;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px 12px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    overflow: hidden;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

/* UNIFIED: Hover effects for all badge cards */
.badge-card:hover,
.badge-item:hover,
#badge-gallery-container .grid > div:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    border-color: #3b82f6;
}

/* ============================================================================ */
/* 🎨 TIER COLORS SYSTEM - UNIFIED (Common, Rare, Epic)                        */
/* ============================================================================ */

/* UNIFIED: Common tier styling */
.badge-card-unlocked.tier-common,
.badge-unlocked.tier-common,
.badge-modal-card.tier-common.unlocked {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #22c55e;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}

/* UNIFIED: Rare tier styling */
.badge-card-unlocked.tier-rare,
.badge-unlocked.tier-rare,
.badge-modal-card.tier-rare.unlocked {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

/* UNIFIED: Epic tier styling */
.badge-card-unlocked.tier-epic,
.badge-unlocked.tier-epic,
.badge-modal-card.tier-epic.unlocked {
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    border-color: #a855f7;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.2);
}

/* UNIFIED: Locked badge styling */
.badge-card-locked,
.badge-locked {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-color: #cbd5e1;
    opacity: 0.6;
    filter: grayscale(80%);
    cursor: not-allowed;
}

/* PERBAIKAN: Tambah selector yang hilang untuk dashboard gallery */
.badge-card.tier-common.unlocked {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #22c55e;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}

.badge-card.tier-rare.unlocked {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.badge-card.tier-epic.unlocked {
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    border-color: #a855f7;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.2);
}

#badge-gallery-container .grid > div.tier-common.unlocked {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #22c55e;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}

#badge-gallery-container .grid > div.tier-rare.unlocked {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

#badge-gallery-container .grid > div.tier-epic.unlocked {
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    border-color: #a855f7;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.2);
}

/* ============================================================================ */
/* 🏷️ TIER INDICATORS & LABELS - UNIFIED                                      */
/* ============================================================================ */

/* UNIFIED: Tier pill/indicator styling */
.badge-tier-pill,
.badge-tier-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 12px;
    letter-spacing: 0.5px;
    z-index: 2;
}

/* UNIFIED: Tier colors for indicators */
.badge-tier-indicator.epic,
.badge-tier-pill.tier-epic { 
    background: linear-gradient(45deg, #8b5cf6, #a855f7); 
}

.badge-tier-indicator.common,
.badge-tier-pill.tier-common { 
    background: linear-gradient(45deg, #10b981, #059669); 
}

.badge-tier-indicator.rare,
.badge-tier-pill.tier-rare { 
    background: linear-gradient(45deg, #3b82f6, #2563eb); 
}

.badge-tier-indicator.legendary { 
    background: linear-gradient(45deg, #f59e0b, #d97706); 
}

/* ============================================================= */
/* 🏷️ TIER LABELS GALERI DASHBOARD - SERAGAM DENGAN MODAL      */
/* ============================================================= */

/* PERBAIKAN: Seragamkan warna teks label pil di galeri dashboard */
.badge-gallery-grid .badge-tier-pill,
.badge-grid .badge-tier-pill,
#badge-gallery-container .absolute.-top-1.-right-1,
#badge-gallery-container .grid > div .absolute {
    color: #ffffff !important;  /* ← Paksa warna putih */
    font-weight: 700 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;  /* ← Tambah bayangan untuk keterbacaan */
}

/* SPECIFIC: Tier colors untuk galeri dashboard - SAMA DENGAN MODAL */
.badge-gallery-grid .badge-tier-pill.tier-common,
.badge-grid .badge-tier-pill.tier-common,
#badge-gallery-container .grid > div .bg-gradient-to-r.from-green-500.to-emerald-500,
#badge-gallery-container .absolute.-top-1.-right-1:contains("COMMON") {
    background: linear-gradient(45deg, #10b981, #059669) !important;
    color: #ffffff !important;
}

.badge-gallery-grid .badge-tier-pill.tier-rare,
.badge-grid .badge-tier-pill.tier-rare,
#badge-gallery-container .grid > div .bg-gradient-to-r.from-blue-500.to-cyan-500,
#badge-gallery-container .absolute.-top-1.-right-1:contains("RARE") {
    background: linear-gradient(45deg, #3b82f6, #2563eb) !important;
    color: #ffffff !important;
}

.badge-gallery-grid .badge-tier-pill.tier-epic,
.badge-grid .badge-tier-pill.tier-epic,
#badge-gallery-container .grid > div .bg-gradient-to-r.from-purple-500.to-pink-500,
#badge-gallery-container .absolute.-top-1.-right-1:contains("EPIC") {
    background: linear-gradient(45deg, #8b5cf6, #a855f7) !important;
    color: #ffffff !important;
}

/* UNIVERSAL: Semua label tier di galeri harus putih */
#badge-gallery-container .grid > div .absolute.-top-1.-right-1 {
    color: #ffffff !important;
    font-weight: 700 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
    letter-spacing: 0.5px !important;
    font-size: 6px !important;
    line-height: 1 !important;
}

/* DARK MODE: Pastikan warna putih tetap di dark mode */
.dark .badge-gallery-grid .badge-tier-pill,
.dark .badge-grid .badge-tier-pill,
.dark #badge-gallery-container .absolute.-top-1.-right-1,
.dark #badge-gallery-container .grid > div .absolute {
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
}

/* ============================================================================ */
/* 🎯 BADGE ICONS & TEXT - UNIFIED                                             */
/* ============================================================================ */

/* UNIFIED: Badge icon sizing for all contexts */
.badge-icon-large,
.badge-icon,
.badge-modal-icon,
.badge-preview-icon,
#badge-gallery-container .text-3xl {
    display: block;
    margin-bottom: 8px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    transition: all 0.3s ease;
}

/* Size variations */
.badge-icon-large { font-size: 32px; }
.badge-icon { font-size: 2.5rem; }
.badge-modal-icon { font-size: 3rem; margin-bottom: 1rem; }
#badge-gallery-container .text-3xl { font-size: 18px; line-height: 1; margin-bottom: 3px; }

/* UNIFIED: Badge text styling */
.badge-title-short,
.badge-name,
.badge-preview-title,
.badge-modal-badge-title,
#badge-gallery-container .text-xs {
    font-weight: 600;
    color: #374151;
    line-height: 1.2;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Size variations for text */
.badge-title-short { font-size: 12px; }
.badge-name { font-size: 11px; }
.badge-preview-title { font-size: 0.75rem; margin: 0; }
.badge-modal-badge-title { font-size: 1rem; margin-bottom: 0.5rem; }
#badge-gallery-container .text-xs { font-size: 8px; margin-top: 0px; word-wrap: break-word; hyphens: auto; }

.badge-progress-summary {
    text-align: center;
    margin-bottom: 16px;
}

.badge-count-text {
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    background: #f3f4f6;
    padding: 6px 12px;
    border-radius: 20px;
}

/* ============================================================================ */
/* 🔘 BUTTONS - UNIFIED                                                        */
/* ============================================================================ */

/* UNIFIED: View all button styling */
.badge-view-all-button,
.badge-view-all-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    margin-top: 1.5rem;
}

/* UNIFIED: Button hover effects */
.badge-view-all-button:hover,
.badge-view-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

/* UNIFIED: Button shimmer effect */
.badge-view-all-button::before,
.badge-view-all-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s;
}

.badge-view-all-button:hover::before,
.badge-view-all-btn:hover::before {
    left: 100%;
}

/* ============================================================================ */
/* 🌙 DARK MODE - UNIFIED (All Dark Mode Overrides)                            */
/* ============================================================================ */

/* UNIFIED: Dark mode for badge cards */
.dark .badge-card,
.dark .badge-item,
.dark #badge-gallery-container .grid > div {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    border-color: #374151;
}

/* UNIFIED: Dark mode tier colors */
.dark .badge-card-unlocked.tier-common,
.dark .badge-unlocked.tier-common {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
    border-color: #059669;
}

.dark .badge-card-unlocked.tier-rare,
.dark .badge-unlocked.tier-rare {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    border-color: #2563eb;
}

.dark .badge-card-unlocked.tier-epic,
.dark .badge-unlocked.tier-epic {
    background: linear-gradient(135deg, #581c87 0%, #6b21a8 100%);
    border-color: #7c3aed;
}

/* UNIFIED: Dark mode text colors */
.dark .badge-title-short,
.dark .badge-name,
.dark .badge-preview-title,
.dark .badge-modal-badge-title {
    color: #d1d5db;
}

.dark .badge-locked .badge-name,
.dark .badge-locked .badge-title-short,
.dark .badge-preview-card.locked .badge-preview-title {
    color: #9ca3af;
}

/* UNIFIED: Dark mode count and progress text */
.dark .badge-count-text {
    color: #9ca3af;
    background: #374151;
}

/* ============================================================================ */
/* 📱 RESPONSIVE DESIGN - UNIFIED                                              */
/* ============================================================================ */

/* Mobile layout adjustments */
@media (max-width: 768px) {
    .badge-gallery-grid,
    .badge-grid,
    #badge-gallery-container .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        min-height: 120px;
    }
    
    .badge-card,
    .badge-item,
    #badge-gallery-container .grid > div {
        padding: 12px 8px;
        min-height: 100px;
        height: 50px;
        max-height: 55px;
    }
    
    .badge-icon-large { font-size: 28px; margin-bottom: 6px; }
    .badge-title-short { font-size: 11px; }
    .badge-tier-pill { font-size: 9px; padding: 3px 6px; }
    #badge-gallery-container .text-3xl { font-size: 16px; margin-bottom: 2px; }
    #badge-gallery-container .text-xs { font-size: 7px; }
    #badge-gallery-container .absolute.-top-1.-right-1 { 
        font-size: 5px; 
        padding: 1px 3px; 
        top: 2px; 
        right: 2px; 
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .badge-gallery-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        min-height: 600px;
    }
    
    .badge-card {
        min-height: 90px;
        padding: 14px 10px 10px;
    }
}

/* Modal responsive */
@media (max-width: 640px) {
    .badge-modal-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .badge-category .grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }
    
    .badge-item h4 { font-size: 0.75rem !important; }
    .badge-item p { font-size: 0.625rem !important; }
}

@media (min-width: 768px) {
    .badge-category .grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (min-width: 1024px) {
    .badge-category .grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* ============================================================================ */
/* 🎭 ANIMATIONS & EFFECTS - UNIFIED                                           */
/* ============================================================================ */

/* Special effects for tier badges */
@keyframes epic-pulse {
    0%, 100% { box-shadow: 0 15px 35px rgba(139, 92, 246, 0.5); }
    50% { box-shadow: 0 20px 45px rgba(139, 92, 246, 0.7); }
}

@keyframes epic-glow {
    from { filter: drop-shadow(0 0 12px rgba(139, 92, 246, 0.7)); }
    to { filter: drop-shadow(0 0 18px rgba(139, 92, 246, 0.9)); }
}

@keyframes bounceIn {
    0% { opacity: 0; transform: scale(0.3) translateY(20px); }
    50% { opacity: 1; transform: scale(1.05) translateY(-5px); }
    70% { transform: scale(0.9) translateY(0px); }
    100% { opacity: 1; transform: scale(1) translateY(0px); }
}

/* Apply animations to specific elements */
.badge-preview-card.tier-epic .badge-preview-icon {
    filter: drop-shadow(0 0 12px rgba(139, 92, 246, 0.7));
    animation: epic-glow 3s ease-in-out infinite alternate;
}

.badge-view-all-button.animate-bounce-in {
    animation: bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Locked badge effects */
.badge-preview-card.locked .badge-preview-icon {
    filter: grayscale(1) opacity(0.5);
}

.badge-preview-card.tier-rare .badge-preview-icon {
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.5));
}

/* Force white text for any colored badge backgrounds */
.bg-orange-400, .bg-yellow-400, .bg-amber-400, 
.bg-blue-600, .bg-indigo-600, .bg-purple-600, .bg-green-600 {
    color: #ffffff !important;
}

.tier-badge {
    position: relative;
    overflow: hidden;
}

.tier-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.tier-badge:hover::before {
    left: 100%;
}

/* Responsive improvements for stats */
@media (max-width: 768px) {
    .stats-card {
        padding: 0.75rem;
    }
    
    .tier-badge {
        padding: 0.5rem 1rem;
    }
    
    .tier-badge .text-2xl {
        font-size: 1.5rem;
    }
    
    .tier-badge .text-lg {
        font-size: 1rem;
    }
}





/* ============================================================================ */
/* 🪟 MODAL SYSTEM - UNIFIED                                                   */
/* ============================================================================ */

/* Modal backdrop and container */
.badge-modal-backdrop {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.badge-modal-container {
    background: #ffffff;
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease-out;
}

.dark .badge-modal-container {
    background: #1f2937;
}

/* Modal header styling */
.badge-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.badge-modal-title {
    font-size: 2rem;
    font-weight: bold;
    margin: 0 0 1rem 0;
    position: relative;
}

.badge-modal-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    position: relative;
}

/* Modal progress and guide sections */
.badge-progress-section {
    background: linear-gradient(135deg, #ffeaa7 0%, #fab1a0 100%);
    margin: 2rem;
    padding: 2rem;
    border-radius: 1rem;
    color: #2d3436;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(250, 177, 160, 0.3);
}

.dark .badge-progress-section {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: #e2e8f0;
}

.badge-guide-section {
    background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
    margin: 0 2rem 2rem 2rem;
    padding: 2rem;
    border-radius: 1rem;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(108, 92, 231, 0.3);
}

/* ============================================================================ */
/* 🎯 MODAL CONTENT & CARDS - UNIFIED                                          */
/* ============================================================================ */

/* Modal category headers */
.badge-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 1rem;
    border-left: 4px solid #667eea;
}

.dark .badge-category-header {
    background: #374151;
    border-color: #8b5cf6;
}

.badge-category-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1f2937;
    margin: 0;
}

.dark .badge-category-title {
    color: #f9fafb;
}

.badge-category-progress {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    background-color: #eef2ff;
    color: #4338ca;
    border-radius: 9999px;
}

.dark .badge-category-progress {
    background-color: #3730a3;
    color: #c7d2fe;
}

/* Modal badge grid */
.badge-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 640px) {
    .badge-modal-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Individual modal badge cards */
.badge-modal-card {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-height: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dark .badge-modal-card {
    background: #374151;
    border-color: #4b5563;
}

.badge-modal-card.unlocked {
    cursor: pointer;
}

.badge-modal-card.unlocked:hover {
    transform: translateY(-3px);
}

.badge-modal-card.locked {
    background: #283141;
    border-color: #374151;
    cursor: not-allowed;
}

.badge-modal-card.locked .badge-modal-icon {
    filter: grayscale(90%) brightness(0.8);
    opacity: 0.9;
}

/* Badge content in modal */
.badge-modal-badge-description {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.4;
    margin-top: 4px;
}

.dark .badge-modal-badge-description {
    color: #9ca3af;
}

.badge-modal-card.locked .badge-modal-badge-description {
    color: #9ca3af;
}

.dark .badge-modal-card.locked .badge-modal-badge-description {
    color: #6b7280;
}

/* ============================================================================ */
/* 📊 PROGRESS BARS & ANIMATIONS - UNIFIED                                     */
/* ============================================================================ */

/* Progress bar container */
.badge-progress-bar {
    width: 100%;
    height: 1rem;
    background: rgba(45, 52, 54, 0.4);
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
    margin: 1rem 0;
    position: relative;
    overflow: hidden;
}

/* Progress bar shimmer effect */
.badge-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    animation: shimmer-container-overlay 3s infinite linear;
}

/* Progress bar fill */
.badge-progress-fill {
    height: 100%;
    border-radius: inherit;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(90deg, #00b894, #74b9ff, #00b894);
    background-size: 200% 100%;
    animation: shimmer-fill-position 2s ease-in-out infinite;
}

/* Progress percentage display */
.badge-progress-percentage {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0.5rem 0;
}

.badge-progress-motivation {
    font-size: 1rem;
    opacity: 0.8;
    margin-top: 0.5rem;
}

/* Progress animations */
@keyframes shimmer-container-overlay {
    0% { left: -100%; }
    100% { left: 100%; }
}

@keyframes shimmer-fill-position {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================================================ */
/* 💬 TOOLTIPS & HOVER EFFECTS - UNIFIED                                       */
/* ============================================================================ */

/* Base tooltip styling */
.tooltip {
    position: absolute;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.has-tooltip:hover .tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Special tooltip for gallery container */
#badge-gallery-container .tooltip {
    bottom: 100%;
    left: 50%;
    transform: translateY(-8px) translateX(-50%) scale(0.9);
    background: rgba(15, 23, 42, 0.95);
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: normal;
    max-width: 350px;
    min-width: 260px;
    text-align: center;
    line-height: 1.5;
    pointer-events: none;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.5);
    word-wrap: break-word;
}

#badge-gallery-container .grid > div:hover .tooltip {
    transform: translateY(-12px) translateX(-50%) scale(1);
    opacity: 1;
    visibility: visible;
}

/* Edge positioning for tooltips */
#badge-gallery-container .grid > div:nth-child(1) .tooltip,
#badge-gallery-container .grid > div:nth-child(4) .tooltip {
    left: 20%;
    transform: translateY(-8px) translateX(-20%) scale(0.9);
}

#badge-gallery-container .grid > div:nth-child(3) .tooltip,
#badge-gallery-container .grid > div:nth-child(6) .tooltip {
    left: auto;
    right: 20%;
    transform: translateY(-8px) translateX(20%) scale(0.9);
}


/* ============================================================================ */
/* 🎨 SPECIAL GALLERY CONTAINER STYLES - DASHBOARD SPECIFIC                    */
/* ============================================================================ */

/* Specific styling for dashboard badge gallery container */
#badge-gallery-container .grid {
    min-height: 140px;
    gap: 6px;
    margin-bottom: 10px;
}

#badge-gallery-container .grid > div {
    height: 60px;
    max-height: 65px;
    padding: 6px 4px 4px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

#badge-gallery-container .flex-1.flex.items-center.justify-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    width: 100%;
}

#badge-gallery-container .flex-shrink-0.w-full {
    flex-shrink: 0;
    width: 100%;
    padding: 0 0.25rem;
    min-height: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

#badge-gallery-container .absolute.-top-1.-right-1 {
    top: 3px;
    right: 3px;
    font-size: 6px;
    padding: 1px 4px;
    line-height: 1;
    z-index: 5;
    border-radius: 6px;
    letter-spacing: 0.5px;
    font-weight: 700;
}

/* ============================================================================ */
/* 🔥 FORCED DARK MODE FOR BADGE GALLERY MODAL                                 */
/* ============================================================================ */

/* Force modal styling regardless of theme */
#badge-gallery-modal .badge-modal-container {
    background-color: #1f2937 !important;
    color: #d1d5db !important;
}

#badge-gallery-modal h2,
#badge-gallery-modal h3,
#badge-gallery-modal h4 {
    color: #f9fafb !important;
}

#badge-gallery-modal .badge-progress-section {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%) !important;
    color: #e2e8f0 !important;
}

#badge-gallery-modal .badge-guide-section {
    background: linear-gradient(135deg, #4a5568 0%, #2c3e50 100%) !important;
    color: #f9fafb !important;
}

#badge-gallery-modal .badge-progress-section *,
#badge-gallery-modal .badge-guide-section * {
    color: inherit !important;
}

#badge-gallery-modal .badge-category-header {
    background-color: #374151 !important;
    border-color: #8b5cf6 !important;
}

#badge-gallery-modal .badge-category-progress {
    background-color: #3730a3 !important;
    color: #c7d2fe !important;
}

#badge-gallery-modal .badge-modal-card {
    background: #374151 !important;
    border-color: #4b5563 !important;
}

#badge-gallery-modal .badge-modal-card.locked {
    background: #283141 !important;
    border-color: #374151 !important;
}

#badge-gallery-modal .badge-modal-card .badge-modal-badge-title {
    color: #f9fafb !important;
}

#badge-gallery-modal .badge-modal-card .badge-modal-badge-description {
    color: #9ca3af !important;
}

#badge-gallery-modal .badge-modal-card.locked .badge-modal-badge-title {
    color: #a0aec0 !important;
}

#badge-gallery-modal .badge-modal-card.locked .badge-modal-badge-description {
    color: #818a99 !important;
}

#badge-gallery-modal .badge-locked-label {
    color: #d1d5db !important;
    background-color: #374151 !important;
    border-color: #4b5563 !important;
}

/* Modal tier colors for forced dark mode */
#badge-gallery-modal .badge-modal-card.unlocked.tier-common {
    background: linear-gradient(135deg, #1f2937 0%, #064e3b 100%) !important;
    border-color: #10b981 !important;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.1) !important;
}

#badge-gallery-modal .badge-modal-card.unlocked.tier-rare {
    background: linear-gradient(135deg, #1f2937 0%, #1e3a8a 100%) !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.15) !important;
}

#badge-gallery-modal .badge-modal-card.unlocked.tier-epic {
    background: linear-gradient(135deg, #1f2937 0%, #581c87 100%) !important;
    border-color: #8b5cf6 !important;
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.2) !important;
}

/* Tier pill colors for modal */
#badge-gallery-modal .badge-tier-pill.tier-common { 
    background-color: #22c55e; 
    color: #ffffff; 
}

#badge-gallery-modal .badge-tier-pill.tier-rare { 
    background-color: #3b82f6; 
    color: #ffffff; 
}

#badge-gallery-modal .badge-tier-pill.tier-epic { 
    background-color: #8b5cf6; 
    color: #ffffff; 
}

/* Text wrapper positioning for modal */
#badge-gallery-modal .badge-modal-text-wrapper {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0.75rem !important;
    flex-grow: 1;
    width: 100%;
    text-align: center;
}

#badge-gallery-modal .badge-tier-pill,
#badge-gallery-modal .badge-locked-label {
    margin-top: auto !important;
    margin-bottom: 0 !important;
    order: 999 !important;
    align-self: center !important;
    flex-shrink: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 16px;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 9999px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border: none;
    min-width: 80px;
    position: static !important;
    top: auto !important;
    right: auto !important;
}

#badge-gallery-modal .badge-locked-label {
    gap: 0.3rem;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    background-color: #6b7280 !important;
    color: #f3f4f6 !important;
    min-width: 100px;
}

/* ============================================================================ */
/* 🎨 ENHANCED MODAL & GALLERY STYLING                                         */
/* ============================================================================ */

/* Enhanced modal backdrop */
#badge-gallery-modal {
    backdrop-filter: blur(8px);
}

#badge-gallery-modal > div {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.dark #badge-gallery-modal > div {
    background: #1f2937;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Scrollbar styling for modal content */
#full-badge-gallery-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(156, 163, 175, 0.5) transparent;
}

#full-badge-gallery-content::-webkit-scrollbar {
    width: 6px;
}

#full-badge-gallery-content::-webkit-scrollbar-track {
    background: transparent;
}

#full-badge-gallery-content::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.5);
    border-radius: 3px;
}

#full-badge-gallery-content::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.7);
}

/* Badge item text responsive sizing */
.badge-item h4 {
    font-size: 0.875rem !important;
    line-height: 1.2 !important;
    word-wrap: break-word !important;
}

.badge-item p {
    font-size: 0.75rem !important;
    line-height: 1.4 !important;
    word-wrap: break-word !important;
}

/* Badge states and hover effects */
.badge-unlocked {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    filter: none;
    opacity: 1;
}

.badge-unlocked:hover {
    transform: translateY(-2px) scale(1.02);
    filter: brightness(1.1);
}

#badge-gallery-container .has-tooltip {
    transition: transform 0.2s ease-in-out;
}

#badge-gallery-container .has-tooltip:hover {
    transform: translateY(-4px);
}

/* Special tier effects */
.badge-preview-card.tier-rare.unlocked:hover .badge-preview-icon {
    animation: badgeUnlockPulse 1.5s ease-in-out infinite;
}

.badge-preview-card.tier-epic.unlocked:hover {
    animation: epicBadgeFloat 2s ease-in-out infinite;
}

.tier-rare.unlocked {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}

.tier-epic.unlocked {
    box-shadow: 0 0 25px rgba(139, 92, 246, 0.3);
}

/* Loading states */
.badge-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

/* Button accessibility */
#open-badge-modal-btn {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

#open-badge-modal-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

#open-badge-modal-btn:hover::before {
    left: 100%;
}

.badge-preview-card:focus,
.badge-modal-card:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .badge-modal-backdrop,
    .badge-view-all-button {
        display: none !important;
    }
    
    .badge-gallery-preview {
        break-inside: avoid;
    }
}

/* Dark theme preference */
@media (prefers-color-scheme: dark) {
    .badge-locked {
        background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
        border-color: #475569;
    }
}

/* ============================================================================ */
/* ============================================================================ */
/* ==   PAKET EFEK VISUAL DINAMIS UNTUK MODAL LENCANA                      == */
/* ============================================================================ */
/* ============================================================================ */


/* ============================================================= */
/* 1. KEYFRAMES UNTUK EFEK BARU                                  */
/* ============================================================= */

/* Untuk kemunculan bertahap */
@keyframes fadeInSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Untuk efek "mengambang" lencana Epic */
@keyframes subtleFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

/* Untuk efek kilauan "idle" lencana Rare */
@keyframes subtleGlow {
  0%, 100% {
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
  }
  50% {
    box-shadow: 0 0 25px rgba(59, 130, 246, 0.4);
  }
}

/* Untuk efek kilauan saat hover */
@keyframes shineEffect {
  from {
    transform: translateX(-110%) skewX(-25deg);
  }
  to {
    transform: translateX(110%) skewX(-25deg);
  }
}


/* ============================================================= */
/* 2. EFEK KEMUNCULAN BERTAHAP (STAGGERED ANIMATION)             */
/* ============================================================= */

/* Terapkan animasi dasar ke semua kartu di modal */
.badge-modal-grid .badge-modal-card {
  opacity: 0;
  animation: fadeInSlideUp 0.5s ease-out forwards;
}

/* Beri jeda untuk setiap kartu (hingga 21+ lencana) */
.badge-modal-grid .badge-modal-card:nth-child(1) { animation-delay: 0.05s; }
.badge-modal-grid .badge-modal-card:nth-child(2) { animation-delay: 0.10s; }
.badge-modal-grid .badge-modal-card:nth-child(3) { animation-delay: 0.15s; }
.badge-modal-grid .badge-modal-card:nth-child(4) { animation-delay: 0.20s; }
.badge-modal-grid .badge-modal-card:nth-child(5) { animation-delay: 0.25s; }
.badge-modal-grid .badge-modal-card:nth-child(6) { animation-delay: 0.30s; }
.badge-modal-grid .badge-modal-card:nth-child(7) { animation-delay: 0.35s; }
.badge-modal-grid .badge-modal-card:nth-child(8) { animation-delay: 0.40s; }
.badge-modal-grid .badge-modal-card:nth-child(9) { animation-delay: 0.45s; }
.badge-modal-grid .badge-modal-card:nth-child(10) { animation-delay: 0.50s; }
.badge-modal-grid .badge-modal-card:nth-child(11) { animation-delay: 0.55s; }
.badge-modal-grid .badge-modal-card:nth-child(12) { animation-delay: 0.60s; }
.badge-modal-grid .badge-modal-card:nth-child(13) { animation-delay: 0.65s; }
.badge-modal-grid .badge-modal-card:nth-child(14) { animation-delay: 0.70s; }
.badge-modal-grid .badge-modal-card:nth-child(15) { animation-delay: 0.75s; }
.badge-modal-grid .badge-modal-card:nth-child(16) { animation-delay: 0.80s; }
.badge-modal-grid .badge-modal-card:nth-child(17) { animation-delay: 0.85s; }
.badge-modal-grid .badge-modal-card:nth-child(18) { animation-delay: 0.90s; }
.badge-modal-grid .badge-modal-card:nth-child(19) { animation-delay: 0.95s; }
.badge-modal-grid .badge-modal-card:nth-child(20) { animation-delay: 1.0s; }
.badge-modal-grid .badge-modal-card:nth-child(21) { animation-delay: 1.05s; }


/* ============================================================= */
/* 3. EFEK "IDLE" BERDASARKAN TIER (KARTU TERASA HIDUP)          */
/* ============================================================= */

/* Efek mengambang untuk lencana EPIC */
#badge-gallery-modal .badge-modal-card.unlocked.tier-epic {
  animation: fadeInSlideUp 0.5s ease-out forwards, 
             subtleFloat 5s ease-in-out infinite 1.2s; /* Tambahkan delay agar tidak langsung bergerak */
}

/* Efek denyut cahaya untuk lencana RARE */
#badge-gallery-modal .badge-modal-card.unlocked.tier-rare {
  animation: fadeInSlideUp 0.5s ease-out forwards,
             subtleGlow 4s ease-in-out infinite 1.2s;
}

/* Jeda animasi idle saat di-hover agar tidak bentrok dengan efek hover */
#badge-gallery-modal .badge-modal-card.unlocked.tier-epic:hover,
#badge-gallery-modal .badge-modal-card.unlocked.tier-rare:hover {
    animation-play-state: paused;
}


/* ============================================================= */
/* 4. EFEK INTERAKTIF (HOVER & ACTIVE STATE)                     */
/* ============================================================= */

/* Efek 3D Tilt saat Hover untuk semua lencana yang terbuka */
#badge-gallery-modal .badge-modal-card.unlocked:hover {
  transform: perspective(1000px) rotateX(5deg) rotateY(-5deg) scale(1.05);
  box-shadow: 0 15px 30px rgba(0,0,0,0.3);
  transition: transform 0.2s ease-out;
}

/* Efek kilauan yang dipicu saat hover */
.badge-modal-card.unlocked::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0) 100%);
  transform: translateX(-150%) skewX(-25deg);
  pointer-events: none;
  transition: transform 0.6s ease-in-out;
}

#badge-gallery-modal .badge-modal-card.unlocked:hover::before {
  transform: translateX(250%) skewX(-25deg);
}

/* Efek "Ditekan" saat di-klik */
#badge-gallery-modal .badge-modal-card.unlocked:active {
    transform: perspective(1000px) scale(0.98);
    transition: transform 0.1s ease-out;
}

/* ============================================================= */
/* 🌟 EFEK KILAUAN INTERAKTIF PADA GALERI DASHBOARD - IDENTIK   */
/* ============================================================= */

/* UNIFIED: Siapkan pseudo-element ::before IDENTIK dengan modal */
.badge-gallery-grid .badge-card.unlocked::before,
.badge-gallery-grid .badge-card:not(.locked)::before,
.badge-grid .badge-card.unlocked::before,
.badge-grid .badge-card:not(.locked)::before,
#badge-gallery-container .grid > div:not(.locked)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, 
        rgba(255,255,255,0) 0%, 
        rgba(255,255,255,0.2) 50%, 
        rgba(255,255,255,0) 100%);
    transform: translateX(-150%) skewX(-25deg);
    pointer-events: none;
    transition: transform 0.6s ease-in-out;  /* ← PERBAIKAN: Sama dengan modal */
    z-index: 2;
    border-radius: inherit;
}

/* DARK MODE: Efek kilau untuk dark theme - IDENTIK DENGAN MODAL */
.dark .badge-gallery-grid .badge-card.unlocked::before,
.dark .badge-gallery-grid .badge-card:not(.locked)::before,
.dark .badge-grid .badge-card.unlocked::before,
.dark .badge-grid .badge-card:not(.locked)::before,
.dark #badge-gallery-container .grid > div:not(.locked)::before {
    background: linear-gradient(to right, 
        rgba(255,255,255,0) 0%, 
        rgba(255,255,255,0.15) 50%, 
        rgba(255,255,255,0) 100%);
}

/* UNIFIED: Picu animasi kilauan saat hover - IDENTIK DENGAN MODAL */
.badge-gallery-grid .badge-card.unlocked:hover::before,
.badge-gallery-grid .badge-card:not(.locked):hover::before,
.badge-grid .badge-card.unlocked:hover::before,
.badge-grid .badge-card:not(.locked):hover::before,
#badge-gallery-container .grid > div:not(.locked):hover::before {
    transform: translateX(250%) skewX(-25deg);
    /* ← PERBAIKAN: Tidak ada transition di sini, sama dengan modal */
}

/* ENHANCED: Tambahan efek hover untuk galeri dashboard - SESUAI MODAL */
.badge-gallery-grid .badge-card.unlocked:hover,
.badge-gallery-grid .badge-card:not(.locked):hover,
#badge-gallery-container .grid > div:not(.locked):hover {
    transform: translateY(-3px) scale(1.05);  /* ← PERBAIKAN: Sesuaikan dengan modal */
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);  /* ← PERBAIKAN: Shadow sama dengan modal */
    transition: all 0.2s ease-out;  /* ← PERBAIKAN: Timing sama dengan modal */
}

/* TIER-SPECIFIC: Efek kilau berdasarkan tier - IDENTIK DENGAN MODAL */
.badge-gallery-grid .badge-card.unlocked.tier-common:hover::before,
.badge-gallery-grid .badge-card-unlocked.tier-common:hover::before,
.badge-card.tier-common.unlocked:hover::before,
#badge-gallery-container .grid > div.tier-common.unlocked:hover::before,
#badge-gallery-container .grid > div.tier-common:not(.locked):hover::before {
    background: linear-gradient(to right, 
        rgba(34,197,94,0) 0%, 
        rgba(34,197,94,0.2) 50%, 
        rgba(34,197,94,0) 100%);
}

.badge-gallery-grid .badge-card.unlocked.tier-rare:hover::before,
.badge-gallery-grid .badge-card-unlocked.tier-rare:hover::before,
.badge-card.tier-rare.unlocked:hover::before,
#badge-gallery-container .grid > div.tier-rare.unlocked:hover::before,
#badge-gallery-container .grid > div.tier-rare:not(.locked):hover::before {
    background: linear-gradient(to right, 
        rgba(59,130,246,0) 0%, 
        rgba(59,130,246,0.2) 50%, 
        rgba(59,130,246,0) 100%);
}

.badge-gallery-grid .badge-card.unlocked.tier-epic:hover::before,
.badge-gallery-grid .badge-card-unlocked.tier-epic:hover::before,
.badge-card.tier-epic.unlocked:hover::before,
#badge-gallery-container .grid > div.tier-epic.unlocked:hover::before,
#badge-gallery-container .grid > div.tier-epic:not(.locked):hover::before {
    background: linear-gradient(to right, 
        rgba(168,85,247,0) 0%, 
        rgba(168,85,247,0.2) 50%, 
        rgba(168,85,247,0) 100%);
}

/* 3D TILT EFFECT: Sama dengan modal */
.badge-gallery-grid .badge-card.unlocked:hover,
.badge-gallery-grid .badge-card:not(.locked):hover,
#badge-gallery-container .grid > div:not(.locked):hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(-5deg) scale(1.05);
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
    transition: transform 0.2s ease-out;
}

/* ACTIVE STATE: Efek tekan sama dengan modal */
.badge-gallery-grid .badge-card.unlocked:active,
.badge-gallery-grid .badge-card:not(.locked):active,
#badge-gallery-container .grid > div:not(.locked):active {
    transform: perspective(1000px) scale(0.98);
    transition: transform 0.1s ease-out;
}

/* ACCESSIBILITY: Fokus state untuk keyboard navigation */
.badge-gallery-grid .badge-card.unlocked:focus::before,
#badge-gallery-container .grid > div:not(.locked):focus::before {
    transform: translateX(250%) skewX(-25deg);
}

/* MOBILE: Efek kilau yang dioptimalkan untuk mobile */
@media (max-width: 768px) {
    .badge-gallery-grid .badge-card.unlocked::before,
    #badge-gallery-container .grid > div:not(.locked)::before {
        width: 40%;
        background: linear-gradient(to right, 
            rgba(255,255,255,0) 0%, 
            rgba(255,255,255,0.15) 50%, 
            rgba(255,255,255,0) 100%);
        transition: transform 0.5s ease-in-out;  /* ← Sedikit lebih cepat di mobile */
    }
}

/* PERFORMANCE: Optimasi untuk animasi yang smooth */
.badge-gallery-grid .badge-card.unlocked,
.badge-grid .badge-card.unlocked,
#badge-gallery-container .grid > div:not(.locked) {
    will-change: transform;
    backface-visibility: hidden;
    transform-style: preserve-3d;
}

/* TOUCH DEVICES: Efek kilau untuk touch/tap */
@media (hover: none) and (pointer: coarse) {
    .badge-gallery-grid .badge-card.unlocked:active::before,
    #badge-gallery-container .grid > div:not(.locked):active::before {
        transform: translateX(250%) skewX(-25deg);
    }
}

/* Picu animasi kilauan HANYA saat hover */
.badge-gallery-grid .badge-card.unlocked:hover::before {
  transform: translateX(250%) skewX(-25deg);
  transition: transform 0.8s ease-in-out;
}

/* ============================================================= */
/* 📘 ENHANCED BADGE GUIDE SECTION STYLING                     */
/* ============================================================= */

/* Guide Section Header */
.badge-guide-header {
    text-align: center;
    margin-bottom: 2rem;
}

.badge-guide-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.dark .badge-guide-title {
    color: #f9fafb;
}

.badge-guide-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

.dark .badge-guide-subtitle {
    color: #9ca3af;
}

/* Enhanced Guide Grid */
.badge-guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Enhanced Guide Items */
.badge-guide-item {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border-left: 4px solid #e5e7eb;
    position: relative;
    overflow: hidden;
}

.badge-guide-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #10b981, #059669);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.badge-guide-item:hover::before {
    transform: translateX(0);
}

.badge-guide-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Dark mode guide items */
.dark .badge-guide-item {
    background: #374151;
    border-left-color: #4b5563;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.dark .badge-guide-item:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

/* Tier-specific styling */
.badge-guide-item.tier-common {
    border-left-color: #10b981;
}

.badge-guide-item.tier-common::before {
    background: linear-gradient(90deg, #10b981, #059669);
}

.badge-guide-item.tier-rare {
    border-left-color: #3b82f6;
}

.badge-guide-item.tier-rare::before {
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
}

.badge-guide-item.tier-epic {
    border-left-color: #8b5cf6;
}

.badge-guide-item.tier-epic::before {
    background: linear-gradient(90deg, #8b5cf6, #7c3aed);
}

/* Tier Header */
.badge-guide-tier-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.badge-guide-tier-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.badge-guide-tier-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937;
    flex-grow: 1;
}

.dark .badge-guide-tier-name {
    color: #f9fafb;
}

.badge-guide-tier-difficulty {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    background: #f3f4f6;
    color: #6b7280;
}

.dark .badge-guide-tier-difficulty {
    background: #4b5563;
    color: #d1d5db;
}

/* Description */
.badge-guide-description {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #4b5563;
    margin-bottom: 1rem;
}

.dark .badge-guide-description {
    color: #d1d5db;
}

.badge-guide-description strong {
    color: #1f2937;
    display: block;
    margin-bottom: 0.5rem;
}

.dark .badge-guide-description strong {
    color: #f9fafb;
}

/* Reward Section */
.badge-guide-reward {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.dark .badge-guide-reward {
    background: #2d3748;
    border-color: #4a5568;
}

.reward-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dark .reward-label {
    color: #a0aec0;
}

.reward-value {
    font-size: 0.875rem;
    font-weight: 700;
    color: #059669;
    background: #d1fae5;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.dark .reward-value {
    color: #68d391;
    background: #065f46;
}

/* Tips Section */
.badge-guide-tips {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #f59e0b;
    margin-top: 1rem;
}

.dark .badge-guide-tips {
    background: linear-gradient(135deg, #451a03 0%, #78350f 100%);
    border-color: #d97706;
}

.tips-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.tips-icon {
    font-size: 1.25rem;
}

.tips-title {
    font-size: 1rem;
    font-weight: 700;
    color: #92400e;
}

.dark .tips-title {
    color: #fbbf24;
}

.tips-content {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #78350f;
}

.dark .tips-content {
    color: #fde68a;
}

.tips-content strong {
    color: #92400e;
    font-weight: 600;
}

.dark .tips-content strong {
    color: #fbbf24;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .badge-guide-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .badge-guide-item {
        padding: 1.25rem;
    }
    
    .badge-guide-tier-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .badge-guide-tips {
        padding: 1.25rem;
    }
}

/* Tambahkan ini ke bagian .badge-guide-item:hover */
.badge-guide-item:hover .badge-guide-tier-icon {
    transform: scale(1.2) rotate(-10deg);
}

/* Tambahkan transisi pada ikon itu sendiri */
.badge-guide-tier-icon {
    font-size: 1.5rem;
    line-height: 1;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Transisi dengan efek 'bounce' */
}

/* Ganti .badge-guide-item:hover yang lama dengan yang ini */
.badge-guide-item:hover {
    transform: perspective(1000px) rotateY(-5deg) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.badge-guide-item::before {
    /* ...properti lain... */
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1); /* Ganti dari 'ease' */
}

/* ============================================================= */
/* 🌙 FORCE DARK MODE UNTUK BADGE GUIDE SECTION                */
/* ============================================================= */

/* FORCE: Badge guide section selalu dark mode di dalam modal */
#badge-gallery-modal .badge-guide-section {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%) !important;
    color: #f9fafb !important;
}

#badge-gallery-modal .badge-guide-header {
    color: #f9fafb !important;
}

#badge-gallery-modal .badge-guide-title {
    color: #f9fafb !important;
}

#badge-gallery-modal .badge-guide-subtitle {
    color: #9ca3af !important;
}

/* FORCE: Guide items selalu dark mode */
#badge-gallery-modal .badge-guide-item {
    background: #374151 !important;
    border-left-color: #4b5563 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    color: #f9fafb !important;
}

#badge-gallery-modal .badge-guide-item:hover {
    background: #4b5563 !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4) !important;
}

/* FORCE: Tier header colors */
#badge-gallery-modal .badge-guide-tier-name {
    color: #f9fafb !important;
}

#badge-gallery-modal .badge-guide-tier-difficulty {
    background: #4b5563 !important;
    color: #d1d5db !important;
}

/* FORCE: Description colors */
#badge-gallery-modal .badge-guide-description {
    color: #d1d5db !important;
}

#badge-gallery-modal .badge-guide-description strong {
    color: #f9fafb !important;
}

/* FORCE: Reward section colors */
#badge-gallery-modal .badge-guide-reward {
    background: #2d3748 !important;
    border-color: #4a5568 !important;
}

#badge-gallery-modal .reward-label {
    color: #a0aec0 !important;
}

#badge-gallery-modal .reward-value {
    color: #68d391 !important;
    background: #065f46 !important;
}

/* FORCE: Tips section dark mode */
#badge-gallery-modal .badge-guide-tips {
    background: linear-gradient(135deg, #451a03 0%, #78350f 100%) !important;
    border-color: #d97706 !important;
    color: #fde68a !important;
}

#badge-gallery-modal .tips-title {
    color: #fbbf24 !important;
}

#badge-gallery-modal .tips-content {
    color: #fde68a !important;
}

#badge-gallery-modal .tips-content strong {
    color: #fbbf24 !important;
}

/* FORCE: Tier-specific border colors tetap terlihat di dark mode */
#badge-gallery-modal .badge-guide-item.tier-common {
    border-left-color: #10b981 !important;
}

#badge-gallery-modal .badge-guide-item.tier-rare {
    border-left-color: #3b82f6 !important;
}

#badge-gallery-modal .badge-guide-item.tier-epic {
    border-left-color: #8b5cf6 !important;
}

/* FORCE: Hover effects untuk tier border */
#badge-gallery-modal .badge-guide-item.tier-common::before {
    background: linear-gradient(90deg, #10b981, #059669) !important;
}

#badge-gallery-modal .badge-guide-item.tier-rare::before {
    background: linear-gradient(90deg, #3b82f6, #1d4ed8) !important;
}

#badge-gallery-modal .badge-guide-item.tier-epic::before {
    background: linear-gradient(90deg, #8b5cf6, #7c3aed) !important;
}