/*
 * Joynal Dark Mode Switcher — Admin Dashboard Dark Mode
 * Version: 1.1.0
 *
 * Targets specific WordPress admin UI elements with safe dark palette colors.
 * Does NOT use filter:invert() or blanket * rules — text and icons stay readable.
 */

/* ============================================================
   Base — HTML & Body
   ============================================================ */
html,
body.wp-admin {
    background-color: #1a1b2e !important;
    color: #e2e8f0 !important;
}

/* ============================================================
   Top Admin Bar (#wpadminbar)
   ============================================================ */
#wpadminbar {
    background: #111827 !important;
    border-bottom: 1px solid #2d3748 !important;
}

#wpadminbar .ab-item,
#wpadminbar a.ab-item,
#wpadminbar > #wp-toolbar span.ab-label,
#wpadminbar .ab-label,
#wpadminbar .display-name {
    color: #e2e8f0 !important;
}

#wpadminbar .ab-top-menu > li:hover > .ab-item,
#wpadminbar .ab-top-menu > li.hover > .ab-item,
#wpadminbar .ab-top-menu > li > .ab-item:focus {
    background: #1e2a3a !important;
    color: #ffffff !important;
}

#wpadminbar .menupop .ab-sub-wrapper,
#wpadminbar .shortcut-menu {
    background: #1e293b !important;
    border: 1px solid #2d3748 !important;
}

#wpadminbar .menupop .ab-sub-wrapper .ab-item,
#wpadminbar .menupop .ab-sub-wrapper a {
    color: #cbd5e1 !important;
}

#wpadminbar .menupop .ab-sub-wrapper .ab-item:hover,
#wpadminbar .menupop .ab-sub-wrapper a:hover {
    background: #2d3748 !important;
    color: #ffffff !important;
}

/* ============================================================
   Left Sidebar — Admin Menu
   ============================================================ */
#adminmenuback,
#adminmenuwrap,
#adminmenu {
    background: #1e293b !important;
}

#adminmenu a,
#adminmenu .wp-has-current-submenu .wp-submenu a,
#adminmenu .wp-menu-name {
    color: #94a3b8 !important;
}

#adminmenu li.current a.menu-top,
#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
#adminmenu .current .wp-menu-name,
#adminmenu li a:hover,
#adminmenu li.menu-top:hover,
#adminmenu li.menu-top:hover > a {
    color: #ffffff !important;
    background: #2d3f58 !important;
}

#adminmenu .wp-submenu,
#adminmenu .wp-has-current-submenu .wp-submenu {
    background: #162032 !important;
}

#adminmenu .wp-submenu a {
    color: #94a3b8 !important;
}

#adminmenu .wp-submenu a:hover,
#adminmenu .wp-submenu li.current a {
    color: #ffffff !important;
    background: transparent !important;
}

#adminmenu .wp-menu-separator {
    background: #2d3748 !important;
}

/* Collapse/expand arrow */
#collapse-button,
#collapse-button:hover {
    background: #1e293b !important;
    color: #94a3b8 !important;
}

/* ============================================================
   Main Content Area
   ============================================================ */
#wpcontent,
#wpbody,
#wpbody-content,
#wpfooter {
    background-color: #1a1b2e !important;
    color: #e2e8f0 !important;
}

.wp-admin .wrap {
    background-color: transparent !important;
    color: #e2e8f0 !important;
}

/* ============================================================
   Headings & Text
   ============================================================ */
.wp-admin h1,
.wp-admin h2,
.wp-admin h3,
.wp-admin h4,
.wp-admin h5,
.wp-admin h6 {
    color: #f1f5f9 !important;
}

.wp-admin p,
.wp-admin span:not(.dashicons),
.wp-admin li,
.wp-admin td,
.wp-admin th,
.wp-admin label {
    color: #cbd5e1 !important;
}

.wp-admin a {
    color: #60a5fa !important;
}

.wp-admin a:hover {
    color: #93c5fd !important;
}

/* ============================================================
   Postboxes / Dashboard Widgets
   ============================================================ */
.wp-admin .postbox,
.wp-admin .metabox-holder,
.wp-admin #dashboard-widgets .postbox {
    background: #1e293b !important;
    border: 1px solid #2d3748 !important;
    color: #e2e8f0 !important;
}

.wp-admin .postbox .hndle,
.wp-admin .postbox h2.hndle,
.wp-admin .postbox h3.hndle {
    background: #253347 !important;
    border-bottom: 1px solid #2d3748 !important;
    color: #f1f5f9 !important;
}

.wp-admin .postbox .inside {
    background: #1e293b !important;
    color: #cbd5e1 !important;
}

/* ============================================================
   Form Elements — Inputs, Selects, Textareas
   ============================================================ */
.wp-admin input[type="text"],
.wp-admin input[type="email"],
.wp-admin input[type="url"],
.wp-admin input[type="number"],
.wp-admin input[type="password"],
.wp-admin input[type="search"],
.wp-admin textarea,
.wp-admin select {
    background-color: #253347 !important;
    color: #e2e8f0 !important;
    border: 1px solid #3d5166 !important;
}

.wp-admin input[type="text"]:focus,
.wp-admin input[type="email"]:focus,
.wp-admin input[type="url"]:focus,
.wp-admin input[type="number"]:focus,
.wp-admin input[type="password"]:focus,
.wp-admin input[type="search"]:focus,
.wp-admin textarea:focus,
.wp-admin select:focus {
    border-color: #60a5fa !important;
    box-shadow: 0 0 0 1px #60a5fa !important;
    outline: none !important;
}

/* Checkboxes and radios — leave browser default, just handle surrounding label */
.wp-admin input[type="checkbox"],
.wp-admin input[type="radio"] {
    accent-color: #60a5fa;
}

/* ============================================================
   Buttons — Keep WP Brand Colors, adjust outlines
   ============================================================ */
.wp-admin .button-primary {
    background: #0073aa !important;
    border-color: #005177 !important;
    color: #ffffff !important;
}

.wp-admin .button-primary:hover {
    background: #0086c3 !important;
}

.wp-admin .button-secondary,
.wp-admin .button {
    background: #2d3748 !important;
    border-color: #4a5568 !important;
    color: #e2e8f0 !important;
}

.wp-admin .button-secondary:hover,
.wp-admin .button:hover {
    background: #374151 !important;
    color: #ffffff !important;
}

/* ============================================================
   Tables — WP_List_Table
   ============================================================ */
.wp-admin table,
.wp-admin .wp-list-table {
    background: #1e293b !important;
    border: 1px solid #2d3748 !important;
    color: #cbd5e1 !important;
}

.wp-admin .wp-list-table th,
.wp-admin .wp-list-table thead th,
.wp-admin table th {
    background: #253347 !important;
    color: #f1f5f9 !important;
    border-bottom: 1px solid #2d3748 !important;
}

.wp-admin .wp-list-table td,
.wp-admin table td {
    background: #1e293b !important;
    color: #cbd5e1 !important;
    border-bottom: 1px solid #253347 !important;
}

.wp-admin .wp-list-table tbody tr:hover td,
.wp-admin table tbody tr:hover td {
    background: #253347 !important;
}

.wp-admin .wp-list-table .column-primary strong a,
.wp-admin .wp-list-table td a {
    color: #60a5fa !important;
}

.wp-admin .tablenav {
    color: #94a3b8 !important;
}

/* ============================================================
   Admin Notices — .notice, .updated, .error
   ============================================================ */
.wp-admin .notice,
.wp-admin div.updated,
.wp-admin div.error,
.wp-admin .notice-info,
.wp-admin .notice-success,
.wp-admin .notice-warning,
.wp-admin .notice-error {
    background: #1e293b !important;
    border-left-color: #60a5fa !important;
    color: #e2e8f0 !important;
}

.wp-admin .notice-success {
    border-left-color: #34d399 !important;
}

.wp-admin .notice-warning {
    border-left-color: #fbbf24 !important;
}

.wp-admin .notice-error,
.wp-admin div.error {
    border-left-color: #f87171 !important;
}

.wp-admin .notice p,
.wp-admin div.updated p,
.wp-admin div.error p {
    color: #cbd5e1 !important;
}

/* ============================================================
   Submenu / Secondary Nav / Screen Options / Help Tab
   ============================================================ */
.wp-admin .nav-tab-wrapper,
.wp-admin .subsubsub {
    border-bottom: 1px solid #2d3748 !important;
}

.wp-admin .nav-tab {
    background: #1e293b !important;
    border-color: #2d3748 !important;
    color: #94a3b8 !important;
}

.wp-admin .nav-tab-active {
    background: #1a1b2e !important;
    border-bottom-color: #1a1b2e !important;
    color: #ffffff !important;
}

.wp-admin .subsubsub a {
    color: #94a3b8 !important;
}

.wp-admin .subsubsub a.current,
.wp-admin .subsubsub .current {
    color: #f1f5f9 !important;
}

/* ============================================================
   Screen Meta / Help
   ============================================================ */
#screen-meta,
#screen-meta-links {
    background: #1e293b !important;
    border: 1px solid #2d3748 !important;
    color: #e2e8f0 !important;
}

#contextual-help-wrap,
#screen-options-wrap {
    background: #1e293b !important;
    border: 1px solid #2d3748 !important;
    color: #e2e8f0 !important;
}

#screen-meta-links .show-settings {
    color: #94a3b8 !important;
    border-color: #2d3748 !important;
}

/* ============================================================
   Drag & Drop / Handles
   ============================================================ */
.wp-admin .ui-sortable-handle,
.wp-admin .handle-order-higher,
.wp-admin .handle-order-lower {
    color: #94a3b8 !important;
}

/* ============================================================
   Footer
   ============================================================ */
#wpfooter {
    border-top: 1px solid #2d3748 !important;
    color: #64748b !important;
}

#wpfooter a {
    color: #60a5fa !important;
}

/* ============================================================
   Plugin-specific Settings Page tweaks in dark mode
   ============================================================ */
.wp-admin .wrap form textarea.code {
    background: #162032 !important;
    color: #e2e8f0 !important;
    border: 1px solid #3d5166 !important;
}
