/**
 * Auth Pages Theme Override
 * Makes the existing auth page design work with light/dark mode
 */

/* Override body background based on theme */
body.bg-theme.bg-theme1 {
    background: var(--color-surface) !important;
    transition: background-color 0.3s ease;
}

body.dark-mode.bg-theme.bg-theme1 {
    background: #0a0e1a !important;
}

/* Card styling for theme */
.card-authentication1 {
    background: var(--color-bg) !important;
    border: 1px solid var(--color-border) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease;
}

body.dark-mode .card-authentication1 {
    background: var(--color-surface-elevated) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important;
}

/* Text colors */
.card-title,
.form-group label,
body.bg-theme .card-authentication1 .card-body {
    color: var(--color-text) !important;
}

/* Input fields */
.form-control {
    background: var(--color-surface) !important;
    border-color: var(--color-border) !important;
    color: var(--color-text) !important;
}

body.dark-mode .form-control {
    background: var(--color-surface) !important;
}

.form-control::placeholder {
    color: var(--color-text-muted) !important;
}

/* Buttons */
.btn-light {
    background: var(--gradient-primary) !important;
    border: none !important;
    color: white !important;
    font-weight: 600;
}

.btn-light:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow) !important;
}

/* Links */
.card-footer a,
.text-warning,
body.bg-theme a {
    color: var(--brand-primary) !important;
}

body.dark-mode .card-footer a,
body.dark-mode .text-warning,
body.dark-mode.bg-theme a {
    color: var(--brand-accent) !important;
}

/* Card footer */
.card-footer {
    background: var(--color-surface) !important;
    border-top-color: var(--color-border) !important;
    color: var(--color-text) !important;
}

/* Alert messages */
.alert {
    background: var(--color-surface) !important;
    border-color: var(--color-border) !important;
    color: var(--color-text) !important;
}

/* Icons in inputs */
.form-control-position i {
    color: var(--color-text-muted) !important;
}

/* Checkbox labels */
.icheck-material-white label {
    color: var(--color-text) !important;
}

/* Color switcher sidebar */
.right-sidebar {
    background: var(--color-bg) !important;
    border-left: 1px solid var(--color-border) !important;
}

.right-sidebar p,
.right-sidebar hr {
    color: var(--color-text) !important;
    border-color: var(--color-border) !important;
}

/* Loader */
.loader-wrapper {
    background: var(--color-bg) !important;
}

.lds-ring div {
    border-color: var(--brand-primary) transparent transparent transparent !important;
}

/* Back to top button */
.back-to-top {
    background: var(--brand-primary) !important;
    color: white !important;
}

body.dark-mode .back-to-top {
    background: var(--brand-accent) !important;
    color: var(--brand-primary) !important;
}

/* Theme toggle positioning for auth pages */
.card-authentication1 .theme-toggle {
    margin: 0;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .card-authentication1 .theme-toggle {
        position: static !important;
        margin: 1rem auto;
        display: flex;
    }
}

/* ===================================
   DASHBOARD PAGES THEME SUPPORT
   =================================== */

/* Dashboard body background */
body.dashboard-body {
    background: var(--color-surface) !important;
    transition: background-color 0.3s ease;
}

body.dark-mode.dashboard-body {
    background: #0a0e1a !important;
}

/* Content wrapper */
.content-wrapper {
    background: transparent !important;
}

/* Dashboard cards */
.card {
    background: var(--color-bg) !important;
    border: 1px solid var(--color-border) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
    transition: all 0.3s ease;
    color: var(--color-text) !important;
}

body.dark-mode .card {
    background: var(--color-surface-elevated) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
}

/* Card headers and bodies */
.card-header,
.card-body,
.card-footer {
    background: transparent !important;
    color: var(--color-text) !important;
    border-color: var(--color-border) !important;
}

.card-body p,
.card-body label,
.card-body h1,
.card-body h2,
.card-body h3,
.card-body h4,
.card-body h5,
.card-body h6 {
    color: var(--color-text) !important;
}

/* Page titles */
.pagetitle h1 {
    color: var(--color-text) !important;
}

/* Dashboard buttons */
.btn-primary {
    background: var(--gradient-primary) !important;
    border: none !important;
    color: white !important;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow) !important;
}

.btn-secondary {
    background: var(--brand-primary) !important;
    border: none !important;
    color: white !important;
    font-weight: 600;
    transition: all 0.3s ease;
}

body.dark-mode .btn-secondary {
    background: var(--brand-primary-light) !important;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

/* Section styling */
section {
    color: var(--color-text) !important;
}

/* All headings */
h1, h2, h3, h4, h5, h6 {
    color: var(--color-text) !important;
}

/* All paragraphs */
p {
    color: var(--color-text) !important;
}

/* All labels */
label {
    color: var(--color-text) !important;
}

/* Dashboard links */
.dashboard-body a {
    color: var(--brand-primary) !important;
    transition: color 0.3s ease;
}

body.dark-mode.dashboard-body a {
    color: var(--brand-accent) !important;
}

.dashboard-body a:hover {
    opacity: 0.8;
}

/* Wrapper background */
#wrapper {
    background: transparent !important;
}

/* ===================================
   LOGO THEME SWITCHING
   =================================== */

/* Light mode - show colored logo, hide white logo */
.logo-light {
    display: block !important;
}

.logo-dark {
    display: none !important;
}

/* Dark mode - hide colored logo, show white logo */
body.dark-mode .logo-light,
html.dark-mode .logo-light {
    display: none !important;
}

body.dark-mode .logo-dark,
html.dark-mode .logo-dark {
    display: block !important;
}

/* ===================================
   DROPDOWN THEME TOGGLE
   =================================== */

/* Theme toggle in dropdown menu */
.theme-toggle-dropdown {
    background: var(--brand-primary) !important;
    color: white !important;
    border: none !important;
    border-radius: 20px !important;
    padding: 5px 15px !important;
    cursor: pointer !important;
    font-size: 1.2rem !important;
    transition: all 0.3s ease !important;
}

body.dark-mode .theme-toggle-dropdown {
    background: var(--brand-accent) !important;
    color: var(--brand-primary) !important;
}

.theme-toggle-dropdown:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2) !important;
}

.theme-toggle-dropdown:active {
    transform: scale(0.95);
}

/* Dropdown menu theme support */
.dropdown-menu {
    background: var(--color-bg) !important;
    border: 1px solid var(--color-border) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15) !important;
}

body.dark-mode .dropdown-menu {
    background: var(--color-surface-elevated) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5) !important;
}

.dropdown-item {
    color: var(--color-text) !important;
}

.dropdown-item:hover {
    background: var(--color-surface) !important;
}

/* User details in dropdown */
.user-details .user-title,
.user-details .user-subtitle {
    color: var(--color-text) !important;
}

/* ===================================
   SIDEBAR LOGO STYLING
   =================================== */

.brand-logo .logo-icon {
    max-width: 200px;
    height: auto;
}
