/* Dark Mode Global Styles - Enhanced with !important for inline style override */

body.dark-mode {
    background: #0F172A !important;
    color: #F1F5F9 !important;
}

/* Override all inline styles with white background */
body.dark-mode [style*="background: white"],
body.dark-mode [style*="background:#fff"],
body.dark-mode [style*="background:#FFF"],
body.dark-mode [style*="background:#FFFFFF"],
body.dark-mode [style*="background: #fff"],
body.dark-mode [style*="background: #FFF"],
body.dark-mode [style*="background: #FFFFFF"] {
    background: #1E293B !important;
    color: #F1F5F9 !important;
}

/* Override all inline styles with light backgrounds */
body.dark-mode [style*="background: #FAFBFC"],
body.dark-mode [style*="background: #F9FAFB"],
body.dark-mode [style*="background: #F5F5F5"],
body.dark-mode [style*="background: #E5E7EB"] {
    background: #1E293B !important;
}

/* Input, Select, Textarea */
body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
    background: #1E293B !important;
    border-color: #334155 !important;
    color: #F1F5F9 !important;
}

body.dark-mode input[style*="background"],
body.dark-mode select[style*="background"],
body.dark-mode textarea[style*="background"] {
    background: #1E293B !important;
    border-color: #334155 !important;
    color: #F1F5F9 !important;
}

body.dark-mode input:focus,
body.dark-mode select:focus,
body.dark-mode textarea:focus {
    border-color: #2563EB !important;
    outline: none !important;
}

/* Cards and containers */
body.dark-mode .card,
body.dark-mode [class*="card"],
body.dark-mode [id*="Form"],
body.dark-mode [id*="form"],
body.dark-mode div[style*="background: white"],
body.dark-mode div[style*="background:#fff"],
body.dark-mode div[style*="background:#FFF"] {
    background: #1E293B !important;
    border-color: #334155 !important;
    color: #F1F5F9 !important;
}

/* Headings */
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6 {
    color: #F1F5F9 !important;
}

body.dark-mode h1[style*="color"],
body.dark-mode h2[style*="color"],
body.dark-mode h3[style*="color"] {
    color: #F1F5F9 !important;
}

/* Labels */
body.dark-mode label,
body.dark-mode .form-group label,
body.dark-mode label[style*="color"] {
    color: #CBD5E1 !important;
}

/* Text elements */
body.dark-mode p,
body.dark-mode span,
body.dark-mode div {
    color: #CBD5E1 !important;
}

body.dark-mode p[style*="color"],
body.dark-mode span[style*="color"],
body.dark-mode div[style*="color"] {
    color: #CBD5E1 !important;
}

/* Tables */
body.dark-mode table {
    background: #1E293B !important;
}

body.dark-mode table th {
    background: #334155 !important;
    color: #F1F5F9 !important;
}

body.dark-mode table td {
    border-color: #334155 !important;
    color: #CBD5E1 !important;
}

body.dark-mode table tr:hover {
    background: #334155 !important;
}

/* Buttons */
body.dark-mode button {
    color: #F1F5F9 !important;
}

body.dark-mode button[style*="background: white"],
body.dark-mode button[style*="background:#fff"] {
    background: #334155 !important;
    color: #F1F5F9 !important;
    border-color: #475569 !important;
}

body.dark-mode .btn,
body.dark-mode button[type="button"],
body.dark-mode button[type="submit"] {
    background: #2563EB !important;
    color: white !important;
    border-color: #2563EB !important;
}

body.dark-mode .btn:hover,
body.dark-mode button:hover {
    background: #1D4ED8 !important;
}

/* Modals */
body.dark-mode .modal,
body.dark-mode [class*="modal"],
body.dark-mode div[style*="background: white"][style*="border-radius"] {
    background: #1E293B !important;
    color: #F1F5F9 !important;
}

/* Links */
body.dark-mode a {
    color: #60A5FA !important;
}

body.dark-mode a:hover {
    color: #93C5FD !important;
}

/* Badges and alerts */
body.dark-mode .badge,
body.dark-mode [class*="badge"] {
    background: #334155 !important;
    color: #F1F5F9 !important;
}

body.dark-mode .alert,
body.dark-mode [class*="alert"] {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #F1F5F9 !important;
}

/* Dropdowns */
body.dark-mode .dropdown-menu,
body.dark-mode [class*="dropdown"] {
    background: #1E293B !important;
    border-color: #334155 !important;
}

body.dark-mode .dropdown-item {
    color: #CBD5E1 !important;
}

body.dark-mode .dropdown-item:hover {
    background: #334155 !important;
    color: #F1F5F9 !important;
}

/* Borders */
body.dark-mode [style*="border: 1px solid #E2E8F0"],
body.dark-mode [style*="border: 1px solid #D1D5DB"],
body.dark-mode [style*="border: 1px solid #E5E7EB"] {
    border-color: #334155 !important;
}

body.dark-mode [style*="border-bottom: 2px solid #E2E8F0"],
body.dark-mode [style*="border-bottom: 1px solid #E2E8F0"] {
    border-bottom-color: #334155 !important;
}

body.dark-mode [style*="border-top: 1px solid #E2E8F0"] {
    border-top-color: #334155 !important;
}

/* Search results and dropdowns */
body.dark-mode [id*="SearchResults"],
body.dark-mode [id*="searchResults"],
body.dark-mode [class*="search-results"] {
    background: #1E293B !important;
    border-color: #334155 !important;
    color: #F1F5F9 !important;
}

body.dark-mode [id*="SearchResults"] div,
body.dark-mode [id*="searchResults"] div {
    color: #CBD5E1 !important;
}

body.dark-mode [id*="SearchResults"] div:hover {
    background: #334155 !important;
}

/* Profile image containers */
body.dark-mode [id*="ProfileImage"],
body.dark-mode [id*="profileImage"] {
    background: #334155 !important;
    border-color: #475569 !important;
}

/* Form sections */
body.dark-mode [style*="padding: 24px"],
body.dark-mode [style*="padding: 20px"] {
    background: #1E293B !important;
}

/* Success/Error messages */
body.dark-mode [style*="background: #D1FAE5"] {
    background: #064E3B !important;
    border-color: #047857 !important;
    color: #D1FAE5 !important;
}

body.dark-mode [style*="background: #FEE2E2"] {
    background: #7F1D1D !important;
    border-color: #991B1B !important;
    color: #FEE2E2 !important;
}

/* Material Icons color override */
body.dark-mode .material-icons {
    color: #CBD5E1 !important;
}

body.dark-mode .material-icons[style*="color"] {
    color: #CBD5E1 !important;
}

/* Specific classes for dark mode */
body.dark-mode .dark-mode-input {
    background: #1E293B !important;
    border-color: #334155 !important;
    color: #F1F5F9 !important;
}

body.dark-mode .dark-mode-dropdown {
    background: #1E293B !important;
    border-color: #334155 !important;
    color: #F1F5F9 !important;
}

body.dark-mode .dark-mode-dropdown div {
    color: #CBD5E1 !important;
}

body.dark-mode .dark-mode-dropdown div:hover {
    background: #334155 !important;
}

/* Tabs container */
body.dark-mode .tabs-container {
    background: #1E293B !important;
    border-color: #334155 !important;
}

/* Tab items */
body.dark-mode .tab-item {
    color: #CBD5E1 !important;
    border-right-color: #334155 !important;
}

body.dark-mode .tab-item.active {
    color: #60A5FA !important;
    background: #1E3A8A !important;
    border-bottom-color: #60A5FA !important;
}

body.dark-mode .tab-item:hover {
    background: #334155 !important;
    color: #F1F5F9 !important;
}

/* User menu */
body.dark-mode .user-menu span {
    color: #F1F5F9 !important;
}

body.dark-mode .user-menu span[style*="color: #6B7280"],
body.dark-mode .user-menu span[style*="color:#6B7280"] {
    color: #94A3B8 !important;
}

body.dark-mode .user-menu:hover {
    background-color: #334155 !important;
}

/* Language selector */
body.dark-mode .language-selector {
    background: #1E293B !important;
    border-color: #334155 !important;
}

body.dark-mode .language-selector select {
    background: #1E293B !important;
    color: #F1F5F9 !important;
}

/* SMS balance info */
body.dark-mode .sms-balance-info,
body.dark-mode [style*="background: #EFF6FF"] {
    background: #1E3A8A !important;
    border-color: #2563EB !important;
}

body.dark-mode .sms-balance-info span,
body.dark-mode .sms-balance-info strong,
body.dark-mode [style*="background: #EFF6FF"] span,
body.dark-mode [style*="background: #EFF6FF"] strong {
    color: #FFFFFF !important;
}

body.dark-mode .sms-balance-info .material-icons {
    color: #FFFFFF !important;
}

/* Patient detail inner tabs */
body.dark-mode .patient-inner-tabs-container,
body.dark-mode [style*="background: white"][style*="border: 1px solid #DEE2E6"] {
    background: #1E293B !important;
    border-color: #334155 !important;
}

body.dark-mode .patient-inner-tabs-bar,
body.dark-mode [style*="background: #F8F9FA"][style*="border-bottom: 1px solid #DEE2E6"] {
    background: #1E293B !important;
    border-bottom-color: #334155 !important;
}

body.dark-mode .inner-tab-btn {
    background: transparent !important;
    color: #CBD5E1 !important;
}

body.dark-mode .inner-tab-btn[style*="color: #495057"],
body.dark-mode .inner-tab-btn[style*="color:#495057"],
body.dark-mode button.inner-tab-btn[style*="color"] {
    color: #CBD5E1 !important;
}

body.dark-mode .inner-tab-btn.active {
    color: #60A5FA !important;
    border-bottom-color: #60A5FA !important;
}

body.dark-mode .inner-tab-btn.active[style*="color: #0066CC"],
body.dark-mode .inner-tab-btn.active[style*="color:#0066CC"],
body.dark-mode button.inner-tab-btn.active[style*="color"] {
    color: #60A5FA !important;
    border-bottom-color: #60A5FA !important;
}

body.dark-mode .inner-tab-btn:hover {
    background: #334155 !important;
    color: #F1F5F9 !important;
}

/* Patient detail - Left side patient info card */
body.dark-mode [style*="background: #F8F9FA"][style*="border-radius: 8px"][style*="border: 1px solid #DEE2E6"] {
    background: #1E293B !important;
    border-color: #334155 !important;
}

body.dark-mode [style*="background: #F8F9FA"][style*="border-radius: 8px"][style*="border: 1px solid #DEE2E6"] h3,
body.dark-mode [style*="background: #F8F9FA"][style*="border-radius: 8px"][style*="border: 1px solid #DEE2E6"] p {
    color: #F1F5F9 !important;
}

body.dark-mode [style*="background: #F8F9FA"][style*="border-radius: 8px"][style*="border: 1px solid #DEE2E6"] p[style*="color: #6B7280"] {
    color: #94A3B8 !important;
}

/* TC Kimlik No input readonly */
body.dark-mode input[readonly][style*="background: #F8F9FA"] {
    background: #1E293B !important;
    border-color: #334155 !important;
    color: #F1F5F9 !important;
}

/* Hide notes button */
body.dark-mode #toggleNotesVisibility[style*="background: #6B7280"] {
    background: #475569 !important;
    color: #F1F5F9 !important;
}

/* Patient detail inner tab content - appointments */
body.dark-mode #inner-tab-appointments [style*="background: white"],
body.dark-mode #inner-tab-appointments [style*="background:#fff"] {
    background: #1E293B !important;
    border-color: #334155 !important;
}

body.dark-mode #inner-tab-appointments [style*="background: white"] [style*="color: #111827"],
body.dark-mode #inner-tab-appointments [style*="background: white"] [style*="color:#111827"] {
    color: #F1F5F9 !important;
}

body.dark-mode #inner-tab-appointments [style*="background: linear-gradient(135deg, #F8F9FA"] {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%) !important;
    border-color: #334155 !important;
}

/* Patient detail inner tab content - planned treatments */
body.dark-mode #inner-tab-planned-treatments [style*="background: white"],
body.dark-mode #inner-tab-planned-treatments [style*="background:#fff"],
body.dark-mode #inner-tab-planned-treatments [style*="background: #FAFBFC"],
body.dark-mode #inner-tab-planned-treatments [style*="background:#FAFBFC"] {
    background: #1E293B !important;
    border-color: #334155 !important;
}

body.dark-mode #inner-tab-planned-treatments [style*="background: #FAFBFC"][style*="border: 1px solid #E5E7EB"] {
    background: #1E293B !important;
    border-color: #334155 !important;
}

body.dark-mode #inner-tab-planned-treatments [style*="background: white"] [style*="color: #111827"],
body.dark-mode #inner-tab-planned-treatments [style*="background: #FAFBFC"] [style*="color: #111827"] {
    color: #F1F5F9 !important;
}

body.dark-mode #inner-tab-planned-treatments [style*="background: linear-gradient(135deg, #F8F9FA"] {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%) !important;
    border-color: #334155 !important;
}

body.dark-mode #inner-tab-planned-treatments [onmouseover*="background='#F3F4F6'"],
body.dark-mode #inner-tab-planned-treatments [onmouseout*="background='#FAFBFC'"] {
    background: #334155 !important;
}

/* Patient detail inner tab content - accounting */
body.dark-mode #inner-tab-accounting [style*="background: white"],
body.dark-mode #inner-tab-accounting [style*="background:#fff"] {
    background: #1E293B !important;
    border-color: #334155 !important;
}

body.dark-mode #inner-tab-accounting [style*="background: linear-gradient(135deg, #E3F2FD"],
body.dark-mode #inner-tab-accounting [style*="background:linear-gradient(135deg, #E3F2FD"],
body.dark-mode #inner-tab-accounting [style*="background: linear-gradient(135deg,#E3F2FD"] {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%) !important;
    border-color: #334155 !important;
}

body.dark-mode #inner-tab-accounting [style*="background: linear-gradient(135deg, #E3F2FD"] [style*="color: #111827"],
body.dark-mode #inner-tab-accounting [style*="background: linear-gradient(135deg, #E3F2FD"] [style*="color:#111827"],
body.dark-mode #inner-tab-accounting [style*="background: linear-gradient(135deg, #E3F2FD"] [style*="color: #6B7280"],
body.dark-mode #inner-tab-accounting [style*="background: linear-gradient(135deg, #E3F2FD"] [style*="color:#6B7280"] {
    color: #F1F5F9 !important;
}

body.dark-mode #inner-tab-accounting [style*="background: linear-gradient(135deg, #E3F2FD"] div[style*="color: #10B981"],
body.dark-mode #inner-tab-accounting [style*="background: linear-gradient(135deg, #E3F2FD"] div[style*="color:#10B981"] {
    color: #34D399 !important;
}

body.dark-mode #inner-tab-accounting [style*="background: linear-gradient(135deg, #E3F2FD"] div[style*="color: #EF4444"],
body.dark-mode #inner-tab-accounting [style*="background: linear-gradient(135deg, #E3F2FD"] div[style*="color:#EF4444"] {
    color: #F87171 !important;
}

body.dark-mode #inner-tab-accounting [style*="background: linear-gradient(135deg, #F8F9FA"] {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%) !important;
    border-color: #334155 !important;
}

body.dark-mode #inner-tab-accounting [style*="background: white"] [style*="color: #111827"],
body.dark-mode #inner-tab-accounting [style*="background: white"] [style*="color:#111827"] {
    color: #F1F5F9 !important;
}

/* Cancel button in patient detail */
body.dark-mode #cancelEditBtn[style*="background: white"] {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #F1F5F9 !important;
}

body.dark-mode [style*="background: #F8F9FA"],
body.dark-mode [style*="background:#F8F9FA"] {
    background: #1E293B !important;
}

body.dark-mode [style*="background: #F9FAFB"],
body.dark-mode [style*="background:#F9FAFB"] {
    background: #1E293B !important;
}

/* Examination detail inner tabs */
body.dark-mode .examination-inner-tabs-bar {
    background: #1E293B !important;
    border-bottom-color: #334155 !important;
}

body.dark-mode .examination-inner-tab-btn {
    background: transparent !important;
    color: #CBD5E1 !important;
}

body.dark-mode .examination-inner-tab-btn.active {
    color: #60A5FA !important;
    border-bottom-color: #60A5FA !important;
}

body.dark-mode .examination-inner-tab-btn:hover {
    background: #334155 !important;
    color: #60A5FA !important;
}

body.dark-mode .examination-inner-tab-panel {
    background: #1E293B !important;
    color: #F1F5F9 !important;
}

/* Settings tabs */
body.dark-mode .settings-menu-item {
    background: transparent !important;
    color: #CBD5E1 !important;
}

body.dark-mode .settings-menu-item.active {
    background: #1E3A8A !important;
    color: #60A5FA !important;
}

body.dark-mode .settings-menu-item:hover {
    background: #334155 !important;
    color: #F1F5F9 !important;
}

body.dark-mode .settings-menu-item[style*="background: #EFF6FF"],
body.dark-mode .settings-menu-item[style*="background:#EFF6FF"] {
    background: #1E3A8A !important;
    color: #60A5FA !important;
}

/* Appointment and examination items */
body.dark-mode .appointment-item,
body.dark-mode .examination-item {
    background: #1E293B !important;
    border-bottom-color: #334155 !important;
}

body.dark-mode .appointment-item:hover,
body.dark-mode .examination-item:hover {
    background: #334155 !important;
}

body.dark-mode .appointment-item[style*="background"],
body.dark-mode .examination-item[style*="background"] {
    background: #1E293B !important;
}

/* Patient detail inner tabs container */
body.dark-mode [style*="background: white"][style*="border: 1px solid #DEE2E6"] {
    background: #1E293B !important;
    border-color: #334155 !important;
}

body.dark-mode [style*="background: white"][style*="border: 1px solid #E5E7EB"] {
    background: #1E293B !important;
    border-color: #334155 !important;
}

/* Examination detail inner tabs container */
body.dark-mode .examination-inner-tabs-container[style*="background: white"] {
    background: #1E293B !important;
    border-color: #334155 !important;
}

/* Patient detail inner tabs container background */
body.dark-mode [style*="background: white"][style*="border: 1px solid #DEE2E6"],
body.dark-mode [style*="background: white"][style*="border: 1px solid #E5E7EB"] {
    background: #1E293B !important;
    border-color: #334155 !important;
}

/* Inner tab content panels */
body.dark-mode .inner-tab-content {
    background: #1E293B !important;
    color: #F1F5F9 !important;
}

body.dark-mode .inner-tab-content[style*="background"] {
    background: #1E293B !important;
}

/* Settings inner tabs */
body.dark-mode [id*="settingsInnerTabsBar"] {
    background: #1E293B !important;
    border-bottom-color: #334155 !important;
}

body.dark-mode [class*="settings-inner-tab"] {
    background: transparent !important;
    color: #CBD5E1 !important;
}

body.dark-mode [class*="settings-inner-tab"].active {
    color: #60A5FA !important;
    border-bottom-color: #60A5FA !important;
}

body.dark-mode [class*="settings-inner-tab"]:hover {
    background: #334155 !important;
    color: #F1F5F9 !important;
}

/* Settings menu items inline style override */
body.dark-mode .settings-menu-item[style*="background: #EFF6FF"],
body.dark-mode .settings-menu-item[style*="background:#EFF6FF"],
body.dark-mode .settings-menu-item[style*="background: transparent"] {
    background: transparent !important;
    color: #CBD5E1 !important;
}

body.dark-mode .settings-menu-item.active[style*="background: #EFF6FF"],
body.dark-mode .settings-menu-item.active[style*="background:#EFF6FF"] {
    background: #1E3A8A !important;
    color: #60A5FA !important;
}

body.dark-mode .settings-menu-item[style*="color: #2563EB"],
body.dark-mode .settings-menu-item[style*="color:#2563EB"] {
    color: #60A5FA !important;
}

body.dark-mode .settings-menu-item[style*="color: #374151"],
body.dark-mode .settings-menu-item[style*="color:#374151"] {
    color: #CBD5E1 !important;
}

/* Subscription badge */
body.dark-mode .subscription-badge {
    color: white !important;
}

/* Main wrapper */
body.dark-mode .main-wrapper {
    background: #0F172A !important;
}

/* User info text */
body.dark-mode .user-info-text .user-name {
    color: #F1F5F9 !important;
}

body.dark-mode .user-info-text .user-role {
    color: #94A3B8 !important;
}

/* All inline style overrides for common patterns */
body.dark-mode [style*="color: #1A202C"],
body.dark-mode [style*="color:#1A202C"],
body.dark-mode [style*="color: #374151"],
body.dark-mode [style*="color:#374151"],
body.dark-mode [style*="color: #111827"],
body.dark-mode [style*="color:#111827"],
body.dark-mode [style*="color: #212529"],
body.dark-mode [style*="color:#212529"] {
    color: #F1F5F9 !important;
}

body.dark-mode [style*="color: #6B7280"],
body.dark-mode [style*="color:#6B7280"] {
    color: #94A3B8 !important;
}

body.dark-mode [style*="background: #F9FAFB"],
body.dark-mode [style*="background:#F9FAFB"],
body.dark-mode [style*="background: #FAFBFC"],
body.dark-mode [style*="background:#FAFBFC"] {
    background: #1E293B !important;
}

body.dark-mode [style*="background: #F3F4F6"],
body.dark-mode [style*="background:#F3F4F6"] {
    background: #334155 !important;
}

body.dark-mode [style*="background: #E3F2FD"],
body.dark-mode [style*="background:#E3F2FD"] {
    background: #1E3A8A !important;
    color: #60A5FA !important;
}

/* User menu specific */
body.dark-mode .user-menu .user-name,
body.dark-mode .user-menu span.user-name {
    color: #F1F5F9 !important;
}

body.dark-mode .user-menu .user-role,
body.dark-mode .user-menu span.user-role {
    color: #94A3B8 !important;
}

/* Tab active state - override inline styles */
body.dark-mode .tab-item.active[style*="background: #FFFFFF"],
body.dark-mode .tab-item.active[style*="background:#FFFFFF"],
body.dark-mode .tab-item.active[style*="background: white"],
body.dark-mode .tab-item.active[style*="background:white"] {
    background: #1E3A8A !important;
    color: #60A5FA !important;
}

/* Notification menu */
body.dark-mode .notification-menu .material-icons[style*="color: #6B7280"] {
    color: #CBD5E1 !important;
}
