
/* Penyesuaian Dasar dari Contoh */
#mission-tab-container {
    border-bottom: 2px solid #ff9900;
}
.mission-tab {
    display: inline-block;
    padding: 12px 20px;
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.875rem;
    transition: all ease-in-out .3s;
    border: 2px solid transparent;
    border-bottom: 0;
    margin-bottom: -2px; /* Agar menutupi border-bottom container */
}
.mission-tab.current-tab {
    background-color: #ff9900;
    color: #ffffff;
    border-color: #ff9900;
    border-radius: 6px 6px 0 0;
}

#mission-tab-content-container {
    position: relative;
    overflow: hidden;
    min-height: 120px; /* Beri tinggi minimal agar tidak aneh saat transisi */
}
.mission-tab-content {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    padding: 20px 10px;
    transition: transform ease-in-out .5s, opacity ease-in-out .5s;
    transform: translateY(-20px);
    opacity: 0;
    pointer-events: none; /* Non-aktifkan interaksi saat tersembunyi */
}
.mission-tab-content.tab-active {
    position: relative; /* Hanya yang aktif yang memakan ruang */
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* Penyesuaian untuk Dark Mode */
.dark .mission-tab {
    color: #d1d5db; /* text-gray-300 */
}
.dark .mission-tab.current-tab {
    background-color: #ff9900;
    color: #ffffff;
}

/* ======================================================== */
/* PERBAIKAN: Latar Belakang Modal MISI Light/Dark Mode   */
/* ======================================================== */

/* Selector ini menargetkan div konten di dalam modal misi */
#mission-modal > div {
    background-color: #ffffff; /* Latar belakang putih untuk mode terang */
}

.dark #mission-modal > div {
    background-color: #1f2937; /* Latar belakang abu gelap untuk mode gelap */
}
/* ======================================================== */
/* PERBAIKAN FINAL: Warna Modal Misi (Mode Terang)        */
/* ======================================================== */

/* Warna Teks Judul & Sub-judul "Misi Harian", dll. */
body:not(.dark) #mission-modal h2,
body:not(.dark) #mission-modal h4 {
    color: #1f2937;
}

/* Warna Kartu Misi yang Belum Selesai di Mode Terang */
body:not(.dark) .mission-item:not(.completed-mission) {
    background-color: #f9fafb; /* Abu-abu sangat terang */
    border-color: #e5e7eb;
}

/* Warna Teks di dalam Kartu Misi yang Belum Selesai */
body:not(.dark) .mission-item:not(.completed-mission) * {
    color: #374151;
}

/* Pengecualian untuk Teks Reward XP agar warnanya tetap terlihat */
body:not(.dark) .mission-item:not(.completed-mission) .text-amber-600 {
    color: #b45309; /* Amber lebih gelap agar kontras */
}

/* ======================================================== */
/* DESAIN FINAL KARTU & TEKS MISI (Mode Terang & Gelap)   */
/* ======================================================== */

/* --- Teks Judul di Modal Misi --- */
body:not(.dark) #mission-modal h2,
body:not(.dark) #mission-modal h4 {
    color: #1f2937;
}

/* --- Kartu Misi BELUM Selesai --- */
/* [Mode Terang] */
body:not(.dark) .mission-item.uncompleted-mission {
    background-color: #ffffff;
    border-color: #e5e7eb;
}
body:not(.dark) .mission-item.uncompleted-mission * {
    color: #374151;
}
body:not(.dark) .mission-item.uncompleted-mission .text-amber-600 {
    color: #b45309;
}

/* [Mode Gelap] */
.dark .mission-item.uncompleted-mission {
    background-color: #374151;
    border-color: #4b5563;
}


/* --- Kartu Misi SUDAH Selesai --- */
/* [Mode Terang] */
body:not(.dark) .mission-item.completed-mission {
    background-color: #f0fdf4;
    border-color: #4ade80;
}
body:not(.dark) .mission-item.completed-mission .font-semibold,
body:not(.dark) .mission-item.completed-mission .text-green-500 {
    color: #16a34a;
}

/* [Mode Gelap] */
.dark .mission-item.completed-mission {
    background-color: #14532d;
    border-color: #22c55e;
}
.dark .mission-item.completed-mission .text-green-500,
.dark .mission-item.completed-mission .text-green-400 {
    color: #86efac;
}
/* ======================================================== /
/ EFEK LIFT PADA KARTU MISI (Mode Terang & Gelap)        /
/ ======================================================== */

.mission-item {
transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.mission-item:hover {
transform: translateY(-3px); /* Efek mengangkat 3 piksel ke atas /
box-shadow: 0 4px 12px rgba(0,0,0,0.05); / Sedikit bayangan saat hover (mode terang) */
}

.dark .mission-item:hover {
box-shadow: 0 4px 15px rgba(0,0,0,0.15); /* Sedikit bayangan saat hover (mode gelap) */
}


/* ========================================================== */
/* MISSION MODAL ENHANCED STYLES - Responsive & Attractive   */
/* ========================================================== */

/* Mission Detail Cards */
.mission-detail-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.mission-detail-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.mission-detail-card:hover::before {
    opacity: 1;
}

/* Mission Modal Responsive Design */
@media (max-width: 768px) {
    #mission-modal > div {
        max-width: 95vw;
        max-height: 85vh;
        margin: 1rem;
    }
    
    .mission-detail-card {
        padding: 1rem;
    }
    
    .mission-detail-card h5 {
        font-size: 1rem;
    }
    
    .mission-detail-card p {
        font-size: 0.875rem;
    }
}

@media (max-width: 640px) {
    .grid.grid-cols-1.md\:grid-cols-2 {
        grid-template-columns: 1fr !important;
    }
    
    .mission-detail-card .flex.justify-between {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .mission-detail-card .ml-4 {
        margin-left: 0;
        align-self: flex-start;
    }
}

/* Enhanced Mission Modal Background */
#mission-modal {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

#mission-modal > div {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* Mission Progress Bar Animation */
.mission-detail-card .h-4.rounded-full {
    position: relative;
    overflow: hidden;
}

.mission-detail-card .h-4.rounded-full::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Tips Section Enhanced Styling */
.bg-gradient-to-br {
    position: relative;
}

.bg-gradient-to-br::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    border-radius: inherit;
    pointer-events: none;
}

/* Category Header Gradient Animation */
.bg-gradient-to-r.from-yellow-500,
.bg-gradient-to-r.from-blue-500,
.bg-gradient-to-r.from-purple-500 {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Enhanced Scrollbar for Mission Modal */
#mission-modal-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(156, 163, 175, 0.5) transparent;
}

#mission-modal-content::-webkit-scrollbar {
    width: 6px;
}

#mission-modal-content::-webkit-scrollbar-track {
    background: transparent;
}

#mission-modal-content::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.5);
    border-radius: 3px;
}

#mission-modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.7);
}

/* Enhanced Mission Completed Cards */
.mission-detail-card {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* ========================================================== */
/* END FORCE DARK MODE FOR MODALS                             */
/* ========================================================== */

/* Improved text contrast for completed missions in light mode */
.mission-detail-card h5,
.mission-detail-card p {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Force high contrast for completed mission text */
.mission-detail-card h5.text-green-950,
.mission-detail-card p.text-green-900,
.mission-detail-card span.text-green-950 {
    color: #052e16 !important; /* Very dark green for maximum contrast in light mode */
    font-weight: 700 !important; /* Extra bold */
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
}

/* Dark mode overrides for completed mission text */
.dark .mission-detail-card h5.text-green-950 {
    color: #f0fdf4 !important; /* Very light green for dark mode */
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8) !important;
}

.dark .mission-detail-card p.text-green-900 {
    color: #dcfce7 !important; /* Light green for dark mode */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6) !important;
}

.dark .mission-detail-card span.text-green-950 {
    color: #f0fdf4 !important; /* Very light green for dark mode */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6) !important;
}

/* Force white text for category headers in both modes */
.category-header-text {
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

.dark .category-header-text {
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5) !important;
}

/* Specific styling for completed mission descriptions */
.mission-detail-card p.text-green-900.font-medium {
    color: #14532d !important; /* Dark green-800 equivalent for light mode */
    font-weight: 600 !important;
}

.dark .mission-detail-card p.text-green-900.font-medium {
    color: #dcfce7 !important; /* Light green for dark mode */
    font-weight: 600 !important;
}

/* Enhanced button gradient for yellow-orange-red */
#open-mission-modal-btn {
    background: linear-gradient(135deg, #fbbf24 0%, #f97316 50%, #dc2626 100%);
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3);
}

#open-mission-modal-btn:hover {
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 50%, #b91c1c 100%);
    box-shadow: 0 6px 20px rgba(251, 191, 36, 0.4);
}

/* Enhanced Mission Modal Header */
.bg-gradient-to-r.from-orange-600.to-red-600 {
    background: linear-gradient(135deg, #ea580c 0%, #dc2626 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}

/* Fallback for browsers that don't support background-clip */
@supports not (-webkit-background-clip: text) {
    .bg-gradient-to-r.from-orange-600.to-red-600 {
        color: #ea580c;
        background: none;
        -webkit-text-fill-color: initial;
    }
}

/* Dark mode fallback */
.dark .bg-gradient-to-r.from-orange-600.to-red-600 {
    background: linear-gradient(135deg, #fb923c 0%, #f87171 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@supports not (-webkit-background-clip: text) {
    .dark .bg-gradient-to-r.from-orange-600.to-red-600 {
        color: #fb923c;
        background: none;
        -webkit-text-fill-color: initial;
    }
}