/* ============================================
   DARK THEME - Minimal & Tailwind-First
   Hanya untuk override yang tidak bisa dengan Tailwind
   ============================================ */

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
}

.dark {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: #475569;
    --accent-color: #60a5fa;
    --accent-hover: #3b82f6;
}

/* Base theme transitions */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Body and main containers */
body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.dark body {
    background-color: var(--bg-primary) !important;
}

.dark .min-h-screen {
    background-color: var(--bg-primary) !important;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-right: 12px;
}

.theme-toggle-btn:hover {
    background: var(--bg-tertiary);
    transform: translateY(-1px);
}

.theme-toggle-btn:active {
    transform: translateY(0);
}

/* Dark theme specific styles - Using Tailwind classes instead */

/* Desktop menu dark theme - Using Tailwind classes instead */

/* Cards and content areas */
.dark .bg-white {
    background-color: var(--bg-secondary) !important;
}

.dark .text-gray-900 {
    color: var(--text-primary) !important;
}

.dark .text-gray-600 {
    color: var(--text-secondary) !important;
}

.dark .text-gray-500 {
    color: var(--text-muted) !important;
}

.dark .border-gray-200 {
    border-color: var(--border-color) !important;
}

/* Mobile app grid dark theme - Using Tailwind classes instead */

/* Form elements */
.dark input,
.dark textarea,
.dark select {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.dark input:focus,
.dark textarea:focus,
.dark select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

/* Buttons */
.dark .btn-primary {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.dark .btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

/* Responsive adjustments - Using Tailwind classes instead */

/* Animation for theme transitions */
@keyframes themeTransition {
    0% {
        opacity: 0.8;
    }
    100% {
        opacity: 1;
    }
}

.dark * {
    animation: themeTransition 0.3s ease;
}

/* Enhanced Dark Mode for All Menu Elements - Using Tailwind classes instead */

/* Village Profile Section */
.dark .village-profile-section {
    background: var(--bg-primary) !important;
}

.dark .village-profile-section h2 {
    color: var(--text-primary) !important;
}

.dark .village-profile-section p {
    color: var(--text-secondary) !important;
}

/* Statistics Cards */
.dark .stat-card {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
}

.dark .stat-card h3 {
    color: var(--text-primary) !important;
}

.dark .stat-card p {
    color: var(--text-secondary) !important;
}

/* News Section */
.dark .news-section {
    background: var(--bg-primary) !important;
}

.dark .news-card {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
}

.dark .news-card:hover {
    background: var(--bg-tertiary) !important;
}

.dark .news-card h3 {
    color: var(--text-primary) !important;
}

.dark .news-card p {
    color: var(--text-secondary) !important;
}

.dark .news-card .text-gray-500 {
    color: var(--text-muted) !important;
}

/* Footer */
.dark footer {
    background: var(--bg-secondary) !important;
    border-top: 1px solid var(--border-color) !important;
}

.dark footer h3 {
    color: var(--text-primary) !important;
}

.dark footer p,
.dark footer a {
    color: var(--text-secondary) !important;
}

.dark footer a:hover {
    color: var(--accent-color) !important;
}

.dark th {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

.dark td {
    border-color: var(--border-color) !important;
    color: var(--text-secondary) !important;
}

.dark tr:hover {
    background: var(--bg-tertiary) !important;
}

/* Pagination */
.dark .pagination a {
    background: var(--bg-secondary) !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-color) !important;
}

.dark .pagination a:hover {
    background: var(--bg-tertiary) !important;
    color: var(--accent-color) !important;
}

.dark .pagination .current {
    background: var(--accent-color) !important;
    color: white !important;
}

/* Modal and Overlay */
.dark .modal {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
}

.dark .modal-header {
    border-bottom: 1px solid var(--border-color) !important;
}

.dark .modal-footer {
    border-top: 1px solid var(--border-color) !important;
}

.dark .overlay {
    background: rgba(0, 0, 0, 0.8) !important;
}

/* Search and Filter Elements */
.dark .search-box {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
}

.dark .filter-btn {
    background: var(--bg-secondary) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border-color) !important;
}

.dark .filter-btn:hover,
.dark .filter-btn.active {
    background: var(--accent-color) !important;
    color: white !important;
}

/* Alert and Notification */
.dark .alert {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
}

.dark .alert-success {
    background: rgba(34, 197, 94, 0.1) !important;
    border-color: rgba(34, 197, 94, 0.3) !important;
    color: #22c55e !important;
}

.dark .alert-error {
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: #ef4444 !important;
}

.dark .alert-warning {
    background: rgba(245, 158, 11, 0.1) !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
    color: #f59e0b !important;
}

/* Scrollbar Dark Theme */
.dark ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.dark ::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.dark ::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Loading States */
.dark .loading {
    background: var(--bg-secondary) !important;
    color: var(--text-secondary) !important;
}

.dark .skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%) !important;
}

/* Responsive Text Improvements - Using Tailwind classes instead */

/* Ensure all text is readable in dark mode */
.dark h1, .dark h2, .dark h3, .dark h4, .dark h5, .dark h6 {
    color: var(--text-primary) !important;
}

.dark p, .dark span, .dark div {
    color: var(--text-secondary) !important;
}

.dark a {
    color: var(--accent-color) !important;
}

.dark a:hover {
    color: var(--accent-hover) !important;
}

/* Override any remaining light mode text */
.dark .text-black {
    color: var(--text-primary) !important;
}

.dark .text-gray-800 {
    color: var(--text-primary) !important;
}

.dark .text-gray-700 {
    color: var(--text-secondary) !important;
}

.dark .text-gray-400 {
    color: var(--text-muted) !important;
}

.dark .text-gray-300 {
    color: var(--text-secondary) !important;
}

/* Fix for organization pages background */
.dark .bg-gradient-to-br {
    background: var(--bg-primary) !important;
}

.dark .from-gray-50 {
    background: var(--bg-primary) !important;
}

.dark .to-gray-100 {
    background: var(--bg-primary) !important;
}

/* Ensure all main content areas have dark background */
.dark .max-w-7xl,
.dark .max-w-4xl,
.dark .max-w-6xl {
    background-color: transparent;
}

.dark .py-4,
.dark .py-6,
.dark .py-8 {
    background-color: transparent;
}

/* Ensure menu is visible in dark mode - Using Tailwind classes instead */

/* Desktop dropdown dark theme - Using Tailwind classes instead */