/* Dark Mode Overrides */

/* Global Variables for Dark Mode */
:root {
    --dm-bg-body: #111827;      /* gray-900 */
    --dm-bg-card: #1f2937;      /* gray-800 */
    --dm-bg-input: #374151;     /* gray-700 */
    --dm-bg-hover: #374151;     /* gray-700 */
    --dm-text-main: #f9fafb;    /* gray-50 */
    --dm-text-muted: #9ca3af;   /* gray-400 */
    --dm-border: #374151;       /* gray-700 */
    --dm-border-light: #4b5563; /* gray-600 */
}

[data-theme="dark"] body {
    background-color: var(--dm-bg-body) !important;
    color: var(--dm-text-main) !important;
}

/* Override Tailwind Backgrounds */
[data-theme="dark"] .bg-white {
    background-color: var(--dm-bg-card) !important;
    color: var(--dm-text-main);
}

[data-theme="dark"] .bg-gray-50,
[data-theme="dark"] .bg-gray-100,
[data-theme="dark"] .bg-gray-200 {
    background-color: var(--dm-bg-card) !important;
    color: var(--dm-text-main);
}

[data-theme="dark"] .explore-list-item:hover {
    background-color: rgba(55, 65, 81, 0.85) !important;
    color: var(--dm-text-main);
}

/* Specific colors for colored backgrounds to be muted in dark mode */
[data-theme="dark"] .bg-purple-100 { background-color: rgba(147, 51, 234, 0.2) !important; color: #e9d5ff !important; }
[data-theme="dark"] .bg-blue-100 { background-color: rgba(59, 130, 246, 0.2) !important; color: #bfdbfe !important; }
[data-theme="dark"] .bg-green-100 { background-color: rgba(34, 197, 94, 0.2) !important; color: #bbf7d0 !important; }
[data-theme="dark"] .bg-yellow-100 { background-color: rgba(234, 179, 8, 0.2) !important; color: #fef08a !important; }
[data-theme="dark"] .bg-red-100 { background-color: rgba(239, 68, 68, 0.2) !important; color: #fecaca !important; }
[data-theme="dark"] .bg-indigo-100 { background-color: rgba(99, 102, 241, 0.2) !important; color: #c7d2fe !important; }
[data-theme="dark"] .bg-orange-50 { background-color: rgba(249, 115, 22, 0.1) !important; border-color: rgba(249, 115, 22, 0.2) !important; }
[data-theme="dark"] .bg-green-50 { background-color: rgba(34, 197, 94, 0.15) !important; color: #bbf7d0 !important; }
[data-theme="dark"] .bg-red-50 { background-color: rgba(239, 68, 68, 0.15) !important; color: #fecaca !important; }
[data-theme="dark"] .bg-blue-50 { background-color: rgba(59, 130, 246, 0.15) !important; color: #bfdbfe !important; }
[data-theme="dark"] .bg-indigo-50 { background-color: rgba(99, 102, 241, 0.15) !important; color: #c7d2fe !important; }
[data-theme="dark"] .bg-yellow-50 { background-color: rgba(234, 179, 8, 0.15) !important; color: #fef08a !important; }

/* Inline element backgrounds for dark mode */
[data-theme="dark"] .bg-white.bg-opacity-50 { background-color: rgba(55, 65, 81, 0.5) !important; }
[data-theme="dark"] .bg-opacity-50 { --tw-bg-opacity: 0.3 !important; }

/* Premium manuel kartı özel stili */
[data-theme="dark"] .premium-manual-card {
    background: linear-gradient(135deg, #4b3208, #7a520d) !important;
    border-color: rgba(234, 179, 8, 0.5) !important;
    color: #fef9c3 !important;
}
[data-theme="dark"] .premium-manual-card label,
[data-theme="dark"] .premium-manual-card h3 {
    color: #fef9c3 !important;
}
[data-theme="dark"] .premium-manual-card input,
[data-theme="dark"] .premium-manual-card select,
[data-theme="dark"] .premium-manual-card button {
    color: #fef9c3;
}

/* Border colors for inline elements */
[data-theme="dark"] .border-green-300 { border-color: rgba(34, 197, 94, 0.4) !important; }
[data-theme="dark"] .border-red-300 { border-color: rgba(239, 68, 68, 0.4) !important; }
[data-theme="dark"] .border-indigo-200 { border-color: rgba(99, 102, 241, 0.4) !important; }
[data-theme="dark"] .border-green-200 { border-color: rgba(34, 197, 94, 0.3) !important; }
[data-theme="dark"] .border-red-200 { border-color: rgba(239, 68, 68, 0.3) !important; }
[data-theme="dark"] .border-blue-200 { border-color: rgba(59, 130, 246, 0.3) !important; }
[data-theme="dark"] .border-yellow-200 { border-color: rgba(234, 179, 8, 0.35) !important; }

/* Text colors for inline elements */
[data-theme="dark"] .text-green-800 { color: #86efac !important; }
[data-theme="dark"] .text-red-800 { color: #fca5a5 !important; }
[data-theme="dark"] .text-indigo-800 { color: #a5b4fc !important; }
[data-theme="dark"] .text-yellow-800 { color: #fef08a !important; }
[data-theme="dark"] .text-yellow-900 { color: #fde68a !important; }
[data-theme="dark"] .text-green-700 { color: #86efac !important; }
[data-theme="dark"] .text-red-700 { color: #fca5a5 !important; }
[data-theme="dark"] .text-indigo-700 { color: #a5b4fc !important; }
[data-theme="dark"] .text-blue-700 { color: #93c5fd !important; }
[data-theme="dark"] .text-blue-600 { color: #93c5fd !important; }
[data-theme="dark"] .text-green-600 { color: #86efac !important; }
[data-theme="dark"] .text-indigo-900 { color: #c7d2fe !important; }
[data-theme="dark"] .text-purple-600 { color: #d8b4fe !important; }

/* Gradient backgrounds for dark mode */
[data-theme="dark"] .from-blue-50,
[data-theme="dark"] .to-blue-100,
[data-theme="dark"] .bg-gradient-to-br.from-blue-50 { 
    --tw-gradient-from: rgba(59, 130, 246, 0.15) !important;
    --tw-gradient-to: rgba(59, 130, 246, 0.25) !important;
    background: linear-gradient(to bottom right, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.25)) !important;
}

[data-theme="dark"] .from-gray-50,
[data-theme="dark"] .to-gray-100,
[data-theme="dark"] .bg-gradient-to-br.from-gray-50 { 
    --tw-gradient-from: rgba(107, 114, 128, 0.15) !important;
    --tw-gradient-to: rgba(107, 114, 128, 0.25) !important;
    background: linear-gradient(to bottom right, rgba(107, 114, 128, 0.15), rgba(107, 114, 128, 0.25)) !important;
}

[data-theme="dark"] .from-green-50,
[data-theme="dark"] .to-green-100,
[data-theme="dark"] .bg-gradient-to-br.from-green-50 { 
    --tw-gradient-from: rgba(34, 197, 94, 0.15) !important;
    --tw-gradient-to: rgba(34, 197, 94, 0.25) !important;
    background: linear-gradient(to bottom right, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.25)) !important;
}

[data-theme="dark"] .from-indigo-50,
[data-theme="dark"] .to-purple-50,
[data-theme="dark"] .bg-gradient-to-br.from-indigo-50 { 
    --tw-gradient-from: rgba(99, 102, 241, 0.15) !important;
    --tw-gradient-to: rgba(147, 51, 234, 0.15) !important;
    background: linear-gradient(to bottom right, rgba(99, 102, 241, 0.15), rgba(147, 51, 234, 0.15)) !important;
}

/* Border colors for push tokens page */
[data-theme="dark"] .border-indigo-100 { border-color: rgba(99, 102, 241, 0.3) !important; }
[data-theme="dark"] .border-indigo-300 { border-color: rgba(99, 102, 241, 0.4) !important; }
[data-theme="dark"] .border-purple-200 { border-color: rgba(147, 51, 234, 0.3) !important; }

/* Override Tailwind Text Colors */
[data-theme="dark"] .text-gray-900,
[data-theme="dark"] .text-gray-800,
[data-theme="dark"] .text-gray-700 {
    color: var(--dm-text-main) !important;
}

[data-theme="dark"] .text-gray-600,
[data-theme="dark"] .text-gray-500 {
    color: var(--dm-text-muted) !important;
}

/* Borders */
[data-theme="dark"] .border-gray-100,
[data-theme="dark"] .border-gray-200,
[data-theme="dark"] .border-gray-300 {
    border-color: var(--dm-border) !important;
}

/* Inputs & Selects */
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="url"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] input[type="tel"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] input[type="month"],
[data-theme="dark"] input[type="week"],
[data-theme="dark"] input[type="datetime-local"],
[data-theme="dark"] input[type="file"],
[data-theme="dark"] input[type="color"],
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background-color: var(--dm-bg-input) !important;
    border-color: var(--dm-border-light) !important;
    color: var(--dm-text-main) !important;
}

/* Tarih/saat inputlari: metin ve takvim ikonu koyu temada okunur olsun */
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] input[type="month"],
[data-theme="dark"] input[type="week"],
[data-theme="dark"] input[type="datetime-local"] {
    color-scheme: dark;
}

/* Webkit takvim/saat ikonunu beyazlat (aksi halde koyu zeminde gorunmez) */
[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="month"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="week"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.6);
    cursor: pointer;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: var(--dm-text-muted) !important;
}

/* Utility hover overrides */
[data-theme="dark"] .hover\:bg-gray-50:hover,
[data-theme="dark"] .hover\:bg-gray-100:hover,
[data-theme="dark"] .hover\:bg-white:hover {
    background-color: rgba(55, 65, 81, 0.85) !important;
    color: var(--dm-text-main) !important;
}

/* Buttons (Standard Tailwind buttons usually fine, just need to ensure text visibility) */
[data-theme="dark"] .sidebar-toggle {
    background-color: var(--dm-bg-card) !important;
    border-color: var(--dm-border) !important;
}

[data-theme="dark"] .sidebar-toggle-icon,
[data-theme="dark"] .sidebar-toggle-icon::before,
[data-theme="dark"] .sidebar-toggle-icon::after {
    background-color: var(--dm-text-main) !important;
}

/* Admin Header */
[data-theme="dark"] .admin-header {
    background-color: var(--dm-bg-card) !important;
    border-bottom-color: var(--dm-border) !important;
}

/* Sidebar Overlay */
[data-theme="dark"] .sidebar {
    border-right: 1px solid var(--dm-border);
}

/* Shadows */
[data-theme="dark"] .shadow-md,
[data-theme="dark"] .shadow-lg {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3) !important;
}

/* Modals / Popups / Cards */
[data-theme="dark"] .login-card {
    background-color: var(--dm-bg-card) !important;
}

/* Custom Elements */
[data-theme="dark"] #tableResult .bg-gray-100 {
    background-color: var(--dm-bg-input) !important;
}

/* Code blocks / Pre */
[data-theme="dark"] pre, 
[data-theme="dark"] code {
    background-color: #111 !important;
    color: #cfcfcf !important;
    border-color: #333 !important;
}

/* Scrollbar for Webkit */
[data-theme="dark"] ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
[data-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--dm-bg-body); 
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--dm-border-light); 
    border-radius: 4px;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #6b7280; 
}
