/* Dark Theme Override */
[data-theme="dark"] {
    background-color: #1a1a1a !important;
}

[data-theme="dark"] body {
    background-color: #1a1a1a !important;
    color: #e0e0e0 !important;
}

[data-theme="dark"] #wrapper {
    background-color: #1a1a1a !important;
}

/* Header backgrounds for dark theme */
[data-theme="dark"] #header {
    background-color: #0F203E !important;
    background-image: url("images/overlay.png"), -moz-linear-gradient(45deg, #2A5AA8 15%, #0F203E 85%) !important;
    background-image: url("images/overlay.png"), -webkit-linear-gradient(45deg, #2A5AA8 15%, #0F203E 85%) !important;
    background-image: url("images/overlay.png"), -ms-linear-gradient(45deg, #2A5AA8 15%, #0F203E 85%) !important;
    background-image: url("images/overlay.png"), linear-gradient(45deg, #2A5AA8 15%, #0F203E 85%) !important;
}

[data-theme="dark"] #header.alt {
    background-color: #0F203E !important;
}

/* Remove dark containers in header content */
[data-theme="dark"] #header h1,
[data-theme="dark"] #header p,
[data-theme="dark"] #header .logo,
[data-theme="dark"] #header .major,
[data-theme="dark"] #header .content {
    background-color: transparent !important;
}

/* Text colors */
[data-theme="dark"] h1, 
[data-theme="dark"] h2, 
[data-theme="dark"] h3, 
[data-theme="dark"] h4, 
[data-theme="dark"] h5, 
[data-theme="dark"] h6 {
    color: #ffffff !important;
}

[data-theme="dark"] p,
[data-theme="dark"] span,
[data-theme="dark"] div,
[data-theme="dark"] li {
    color: #e0e0e0 !important;
}

[data-theme="dark"] a {
    color: #E6DFC7 !important;
}

[data-theme="dark"] a:hover {
    color: #D3CAAD !important;
}

/* Main content areas */
[data-theme="dark"] #main {
    background-color: #1a1a1a !important;
}

[data-theme="dark"] .main {
    background-color: #1a1a1a !important;
}

[data-theme="dark"] .main.special {
    background-color: #1a1a1a !important;
}

/* Navigation */
[data-theme="dark"] #nav {
    background-color: #2d2d2d !important;
}

[data-theme="dark"] #nav a {
    color: #e0e0e0 !important;
}

[data-theme="dark"] #nav a:hover,
[data-theme="dark"] #nav a.active {
    color: #D3CAAD !important;
}

[data-theme="dark"] #nav h1, 
[data-theme="dark"] #nav h2, 
[data-theme="dark"] #nav h3, 
[data-theme="dark"] #nav h4, 
[data-theme="dark"] #nav h5, 
[data-theme="dark"] #nav h6 {
    color: #ffffff !important;
}

/* Buttons - Nuclear option for white text */
[data-theme="dark"] .button,
[data-theme="dark"] a.button,
[data-theme="dark"] .actions .button,
[data-theme="dark"] ul.actions li a.button,
[data-theme="dark"] ul.actions.special li a.button,
[data-theme="dark"] .actions.special .button,
[data-theme="dark"] #footer .button,
[data-theme="dark"] #footer a.button,
[data-theme="dark"] .main .button,
[data-theme="dark"] .main a.button {
    color: #ffffff !important;
}

[data-theme="dark"] .button:hover,
[data-theme="dark"] a.button:hover,
[data-theme="dark"] .actions .button:hover,
[data-theme="dark"] ul.actions li a.button:hover,
[data-theme="dark"] ul.actions.special li a.button:hover,
[data-theme="dark"] .actions.special .button:hover,
[data-theme="dark"] #footer .button:hover,
[data-theme="dark"] #footer a.button:hover,
[data-theme="dark"] .main .button:hover,
[data-theme="dark"] .main a.button:hover {
    color: #ffffff !important;
}

/* Force all button text to be white - Ultimate override */
[data-theme="dark"] .button *,
[data-theme="dark"] a.button *,
[data-theme="dark"] button *,
[data-theme="dark"] input[type="button"] *,
[data-theme="dark"] input[type="submit"] * {
    color: #ffffff !important;
}

/* Target any remaining button elements */
[data-theme="dark"] button,
[data-theme="dark"] input[type="button"],
[data-theme="dark"] input[type="submit"] {
    color: #ffffff !important;
}

/* Override any text color inheritance */
[data-theme="dark"] * a.button,
[data-theme="dark"] * .button {
    color: #ffffff !important;
}

[data-theme="dark"] .button.primary,
[data-theme="dark"] a.button.primary {
    color: #ffffff !important;
}

[data-theme="dark"] .button.primary:hover,
[data-theme="dark"] a.button.primary:hover {
    color: #ffffff !important;
}

/* Social icons - dark for beige background */
[data-theme="dark"] .icon {
    color: #000000 !important;
}

[data-theme="dark"] .icon.major {
    color: #333333 !important;
}

[data-theme="dark"] .button.primary {
    background-color: #0F203E !important;
    border-color: #0F203E !important;
}

[data-theme="dark"] .button.primary:hover {
    background-color: #1F4788 !important;
    border-color: #1F4788 !important;
}

/* Features section */
[data-theme="dark"] .features li {
    background-color: #2d2d2d !important;
    border-color: #555 !important;
}

/* Statistics section */
[data-theme="dark"] .statistics li {
    background-color: #2d2d2d !important;
    border-color: #555 !important;
}

[data-theme="dark"] .statistics strong {
    color: #D3CAAD !important;
}

/* Icons */
[data-theme="dark"] .icon {
    color: #D3CAAD !important;
}

[data-theme="dark"] .icon.major {
    color: #E6DFC7 !important;
}

/* Footer */
[data-theme="dark"] #footer {
    background-color: #1a1a1a !important;
    color: #e0e0e0 !important;
}

[data-theme="dark"] #footer h1,
[data-theme="dark"] #footer h2,
[data-theme="dark"] #footer h3,
[data-theme="dark"] #footer h4,
[data-theme="dark"] #footer h5,
[data-theme="dark"] #footer h6 {
    color: #ffffff !important;
}

[data-theme="dark"] #footer a {
    color: #E6DFC7 !important;
}

[data-theme="dark"] #footer a:hover {
    color: #D3CAAD !important;
}

/* Override light theme footer text colors in dark mode */
[data-theme="dark"] #footer strong {
    color: #ffffff !important;
}

[data-theme="dark"] #footer dt {
    color: #ffffff !important;
}

/* Footer form styling for dark mode */
[data-theme="dark"] #footer input,
[data-theme="dark"] #footer textarea,
[data-theme="dark"] #footer select {
    background-color: #2d2d2d !important;
    border-color: #666 !important;
    color: #ffffff !important;
}

[data-theme="dark"] #footer input:focus,
[data-theme="dark"] #footer textarea:focus,
[data-theme="dark"] #footer select:focus {
    border-color: #D3CAAD !important;
    box-shadow: 0 0 0 1px #D3CAAD !important;
}

[data-theme="dark"] #footer input::placeholder,
[data-theme="dark"] #footer textarea::placeholder {
    color: #ccc !important;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: #ccc !important;
}

[data-theme="dark"] #footer select option {
    background-color: #2d2d2d !important;
    color: #ffffff !important;
}

/* Form elements */
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background-color: #3d3d3d !important;
    border-color: #555 !important;
    color: #e0e0e0 !important;
}

[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
    border-color: #D3CAAD !important;
    box-shadow: 0 0 0 1px #D3CAAD !important;
}

/* Tables and boxes */
[data-theme="dark"] .box {
    background-color: #2d2d2d !important;
    border-color: #555 !important;
    color: #e0e0e0 !important;
}

[data-theme="dark"] table {
    background-color: #2d2d2d !important;
    color: #e0e0e0 !important;
}

[data-theme="dark"] table th {
    background-color: #3d3d3d !important;
    color: #ffffff !important;
    border-color: #555 !important;
}

[data-theme="dark"] table td {
    border-color: #555 !important;
    background-color: #2d2d2d !important;
}

[data-theme="dark"] table tbody tr {
    border-color: #555 !important;
}

[data-theme="dark"] table tbody tr:nth-child(2n + 1) {
    background-color: #333 !important;
}

/* Blockquotes */
[data-theme="dark"] blockquote {
    background-color: #2d2d2d !important;
    border-left-color: #D3CAAD !important;
    color: #e0e0e0 !important;
}

/* Code blocks */
[data-theme="dark"] code {
    background-color: #3d3d3d !important;
    color: #e0e0e0 !important;
}

[data-theme="dark"] pre {
    background-color: #2d2d2d !important;
    color: #e0e0e0 !important;
    border-color: #555 !important;
}

/* HR elements */
[data-theme="dark"] hr {
    border-color: #555 !important;
}

/* Lists */
[data-theme="dark"] ul.alt li {
    border-color: #555 !important;
}

/* Sections */
[data-theme="dark"] .spotlight .content {
    background-color: transparent !important;
}

[data-theme="dark"] .spotlight .image {
    background-color: transparent !important;
}

/* Special sections */
[data-theme="dark"] section {
    background-color: #1a1a1a !important;
}

/* Progress bars and gradients */
[data-theme="dark"] .progress-bar {
    background-image: -moz-linear-gradient(90deg, #5B87D6, #2A5AA8, #D3CAAD) !important;
    background-image: -webkit-linear-gradient(90deg, #5B87D6, #2A5AA8, #D3CAAD) !important;
    background-image: -ms-linear-gradient(90deg, #5B87D6, #2A5AA8, #D3CAAD) !important;
    background-image: linear-gradient(90deg, #5B87D6, #2A5AA8, #D3CAAD) !important;
}

/* Ensure all white backgrounds become dark */
[data-theme="dark"] .main .box,
[data-theme="dark"] .main section,
[data-theme="dark"] .content,
[data-theme="dark"] .major {
    background-color: #1a1a1a !important;
}

/* White text areas in dark theme */
[data-theme="dark"] .box.alt {
    background-color: #2d2d2d !important;
}

/* Ensure form styling */
[data-theme="dark"] label {
    color: #e0e0e0 !important;
}

[data-theme="dark"] .field {
    background-color: #1a1a1a !important;
}

/* Generic dark overrides for any missed elements */
[data-theme="dark"] * {
    border-color: #555 !important;
}

[data-theme="dark"] *:not(.button):not(.icon) {
    background-color: inherit;
    color: inherit;
}

/* FINAL BUTTON OVERRIDE - This must be last */
html[data-theme="dark"] body .button:not(.primary),
html[data-theme="dark"] body a.button:not(.primary) {
    color: #ffffff !important;
    text-decoration: none !important;
}

html[data-theme="dark"] body .button:not(.primary):hover,
html[data-theme="dark"] body a.button:not(.primary):hover {
    color: #ffffff !important;
    text-decoration: none !important;
}

html[data-theme="dark"] body .button.primary,
html[data-theme="dark"] body a.button.primary {
    color: #ffffff !important;
    text-decoration: none !important;
}

/* Ensure Oswald font works in dark theme */
[data-theme="dark"] .major h2 {
    font-family: 'Oswald', sans-serif !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
}