/**
 * Dark Mode Styles
 * Kontomistrz Theme
 */

/* Dark theme colors */
[data-theme="dark"] {
    /* Background colors */
    --color-bg: #0f172a;
    --color-bg-secondary: #1e293b;
    --color-bg-card: #1e293b;
    --color-bg-muted: #334155;

    /* Text colors */
    --color-text: #f1f5f9;
    --color-text-secondary: #94a3b8;
    --color-text-muted: #64748b;

    /* Border colors */
    --color-border: #334155;
    --color-border-light: #475569;

    /* Primary color adjustments */
    --color-primary: #5b4cfc;
    --color-primary-light: rgba(73, 62, 251, 0.2);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-base: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px -1px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
}

/* Body */
[data-theme="dark"] body,
[data-theme="dark"] {
    background-color: #0f172a;
    color: #f1f5f9;
}

/* Links */
[data-theme="dark"] a {
    color: #5b4cfc;
}

/* Code */
[data-theme="dark"] code {
    background-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] pre {
    background-color: #0d1117;
}

/* Form inputs */
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background-color: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: #64748b;
}

[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
    border-color: #493efb;
    background-color: #0f172a;
}

/* Tables */
[data-theme="dark"] table th {
    background-color: #334155;
}

[data-theme="dark"] table tr:nth-child(even) {
    background-color: rgba(51, 65, 85, 0.5);
}

[data-theme="dark"] table tr:hover {
    background-color: #334155;
}

/* Cards */
[data-theme="dark"] .card,
[data-theme="dark"] .offer-card,
[data-theme="dark"] .bank-card,
[data-theme="dark"] .promo-card {
    background-color: #1e293b;
    border-color: #334155;
}

/* Header */
[data-theme="dark"] .header {
    background-color: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .header.is-scrolled {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
}

/* Footer */
[data-theme="dark"] .footer {
    background-color: #0f172a;
}

/* Buttons - outline */
[data-theme="dark"] .btn--outline {
    border-color: #475569;
    color: #f1f5f9;
}

[data-theme="dark"] .btn--outline:hover {
    background-color: #334155;
}

/* Alerts */
[data-theme="dark"] .alert--info {
    background-color: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .alert--success {
    background-color: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
}

[data-theme="dark"] .alert--warning {
    background-color: rgba(234, 179, 8, 0.15);
    border-color: rgba(234, 179, 8, 0.3);
}

[data-theme="dark"] .alert--danger {
    background-color: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
}

/* Sidebar widgets */
[data-theme="dark"] .widget,
[data-theme="dark"] .sidebar-widget {
    background-color: #1e293b;
    border-color: #334155;
}

/* Calculator */
[data-theme="dark"] .calculator {
    background-color: #1e293b;
}

[data-theme="dark"] .calculator__header {
    background-color: #334155;
}

[data-theme="dark"] .calculator__result {
    background-color: #334155;
}

/* Mega menu */
[data-theme="dark"] .mega-menu,
[data-theme="dark"] .mega-menu__content {
    background-color: #1e293b;
    border-color: #334155;
}

/* Mobile menu */
[data-theme="dark"] .mobile-menu {
    background-color: #0f172a;
}

[data-theme="dark"] .mobile-menu__level {
    background-color: #0f172a;
}

/* HR */
[data-theme="dark"] hr {
    border-color: #334155;
}

/* Blockquote */
[data-theme="dark"] blockquote {
    background-color: #334155;
    border-left-color: #493efb;
}

/* Scrollbar */
[data-theme="dark"] ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #1e293b;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 5px;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Selection */
[data-theme="dark"] ::selection {
    background-color: rgba(73, 62, 251, 0.4);
    color: #f1f5f9;
}

/* Images - slight opacity adjustment */
[data-theme="dark"] img {
    opacity: 0.95;
}

[data-theme="dark"] img:hover {
    opacity: 1;
}

/* Theme toggle button styles */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background-color: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, transform 0.2s;
}

.theme-toggle:hover {
    background-color: #493efb;
    color: #fff;
    transform: scale(1.05);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

.theme-toggle__icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle__icon--light {
    display: flex;
}

.theme-toggle__icon--dark {
    display: none;
}

[data-theme="dark"] .theme-toggle {
    background-color: #334155;
    color: #f1f5f9;
}

[data-theme="dark"] .theme-toggle:hover {
    background-color: #493efb;
}

[data-theme="dark"] .theme-toggle__icon--light {
    display: none;
}

[data-theme="dark"] .theme-toggle__icon--dark {
    display: flex;
}

/* Transition for smooth theme switching */
html.theme-transition,
html.theme-transition *,
html.theme-transition *::before,
html.theme-transition *::after {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease !important;
}
