/* STUPA Account Theme - keycloak.v3 Override */

/* CSS Variables */
:root {
    --primary-color: #00a75d;
    --primary-hover: #008a4a;
    --bg-primary: #1a1a1a;
    --bg-secondary: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #666666;
    --border-color: #3a3a3a;
    --input-bg: #1a1a1a;
    --error-color: #ff4444;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Main backgrounds */
html,
body,
.pf-v5-c-page,
.pf-c-page {
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
        Arial, sans-serif !important;
}

/* Remove all PatternFly backgrounds */
.pf-v5-c-page__main,
.pf-v5-c-page__main-section,
.pf-c-page__main,
.pf-c-page__main-section,
.pf-v5-c-page__main-container,
.pf-c-page__main-container {
    background: transparent !important;
}

/* Header/Masthead */
.pf-v5-c-masthead,
.pf-c-masthead {
    background: var(--bg-secondary) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

/* Logo - Remove the filter that makes it completely white */
.pf-v5-c-brand,
.pf-c-brand,
.pf-v5-c-masthead__brand img,
.pf-c-masthead__brand img {
    /* Remove filter to keep original logo colors */
    filter: none !important;
    height: 40px;
}

/* Navigation sidebar */
.pf-v5-c-page__sidebar,
.pf-c-page__sidebar {
    background: var(--bg-secondary) !important;
    border-right: 1px solid var(--border-color) !important;
}

/* Navigation links */
.pf-v5-c-nav__link,
.pf-c-nav__link {
    color: var(--text-secondary) !important;
    border: none !important;
    padding: 12px 20px !important;
}

.pf-v5-c-nav__link:hover,
.pf-c-nav__link:hover {
    color: var(--text-primary) !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

.pf-v5-c-nav__link.pf-m-current,
.pf-c-nav__link.pf-m-current {
    color: var(--primary-color) !important;
    background: rgba(0, 167, 93, 0.1) !important;
    border-left: 3px solid var(--primary-color) !important;
}

/* Main content */
.pf-v5-c-page__main-section,
.pf-c-page__main-section {
    padding: 30px !important;
}

/* Titles */
.pf-v5-c-title,
.pf-c-title,
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-primary) !important;
}

/* Cards */
.pf-v5-c-card,
.pf-c-card {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

/* Forms */
.pf-v5-c-form,
.pf-c-form {
    background: transparent !important;
}

.pf-v5-c-form__group,
.pf-c-form__group {
    margin-bottom: 24px !important;
}

/* Form labels */
.pf-v5-c-form__label,
.pf-c-form__label,
.pf-v5-c-form__label-text,
.pf-c-form__label-text {
    color: var(--text-secondary) !important;
    font-size: 14px !important;
    margin-bottom: 8px !important;
}

/* Fix input fields - remove double borders and blue focus */
div:has(
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    textarea,
    select
) {
    span {
        border-radius: 4px;

        input {
            border-radius: 4px;
            border: solid 1px var(--border-color);
        }
    }

    span::after {
        display: none;
    }
}

a.pf-m-current::after {
    border-color: var(--primary-color) !important;
}

a.pf-v5-c-jump-links__link::before {
    border-color: var(--primary-color) !important;
}

button.pf-m-secondary::after {
    border-color: var(--primary-color) !important;
}

/* Remove blue focus states and double borders */
.pf-v5-c-form-control:focus,
.pf-c-form-control:focus,
input:focus,
textarea:focus,
select:focus,
.pf-v5-c-form-control.pf-m-resize-both:focus,
.pf-v5-c-form-control.pf-m-resize-horizontal:focus,
.pf-v5-c-form-control.pf-m-resize-vertical:focus {
    background: var(--input-bg) !important;
    background-color: var(--input-bg) !important;
    border: 1px solid var(--primary-color) !important;
    border-bottom: 1px solid var(--primary-color) !important;
    box-shadow: 0 0 0 2px rgba(0, 167, 93, 0.15) !important;
    outline: none !important;
}

/* Disabled inputs */
.pf-v5-c-form-control:disabled,
.pf-c-form-control:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    background: var(--border-color) !important;
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

/* Remove any PatternFly input group styling that adds borders */
.pf-v5-c-input-group,
.pf-c-input-group {
    border: none !important;
}

.pf-v5-c-input-group__item,
.pf-c-input-group__item {
    border: none !important;
}

/* Buttons */
.pf-v5-c-button,
.pf-c-button {
    border-radius: 8px !important;
    font-weight: 500 !important;
    padding: 10px 20px !important;
    transition: all 0.3s ease !important;
    border: none !important;
}

.pf-v5-c-button.pf-m-primary,
.pf-c-button.pf-m-primary {
    background: var(--primary-color) !important;
    color: white !important;
}

.pf-v5-c-button.pf-m-primary:hover,
.pf-c-button.pf-m-primary:hover {
    background: var(--primary-hover) !important;
    transform: translateY(-1px) !important;
}

.pf-v5-c-button.pf-m-secondary,
.pf-c-button.pf-m-secondary,
.pf-v5-c-button.pf-m-control,
.pf-c-button.pf-m-control {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
}

.pf-v5-c-button.pf-m-link,
.pf-c-button.pf-m-link {
    color: var(--primary-color) !important;
    background: transparent !important;
}

/* Tables */
.pf-v5-c-table,
.pf-c-table {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}

.pf-v5-c-table thead,
.pf-c-table thead {
    background: rgba(0, 167, 93, 0.1) !important;
}

.pf-v5-c-table th,
.pf-c-table th {
    color: var(--primary-color) !important;
    padding: 12px !important;
    border-bottom: 2px solid var(--primary-color) !important;
    font-weight: 600 !important;
}

.pf-v5-c-table td,
.pf-c-table td {
    color: var(--text-primary) !important;
    padding: 12px !important;
    border-bottom: 1px solid var(--border-color) !important;
}

/* Horizontal dividers/separators */
.pf-v5-c-divider,
.pf-c-divider,
hr {
    border: none !important;
    border-top: 1px solid var(--border-color) !important;
    margin: 20px 0 !important;
}

/* Alerts */
.pf-v5-c-alert,
.pf-c-alert {
    border-radius: 8px !important;
    margin-bottom: 20px !important;
}

.pf-v5-c-alert.pf-m-danger,
.pf-c-alert.pf-m-danger {
    background: rgba(255, 68, 68, 0.1) !important;
    border: 1px solid var(--error-color) !important;
    color: var(--error-color) !important;
}

.pf-v5-c-alert.pf-m-success,
.pf-c-alert.pf-m-success {
    background: rgba(0, 167, 93, 0.1) !important;
    border: 1px solid var(--primary-color) !important;
    color: var(--primary-color) !important;
}

/* Tabs */
.pf-v5-c-tabs__list,
.pf-c-tabs__list {
    border-bottom: 1px solid var(--border-color) !important;
}

.pf-v5-c-tabs__link,
.pf-c-tabs__link {
    color: var(--text-secondary) !important;
    background: transparent !important;
    border: none !important;
}

.pf-v5-c-tabs__link:hover,
.pf-c-tabs__link:hover {
    color: var(--text-primary) !important;
    background: transparent !important;
}

.pf-v5-c-tabs__link.pf-m-current,
.pf-c-tabs__link.pf-m-current {
    color: var(--primary-color) !important;
    border-bottom: 3px solid var(--primary-color) !important;
}

/* Dropdown menus */
.pf-v5-c-dropdown__menu,
.pf-c-dropdown__menu,
.pf-v5-c-menu,
.pf-c-menu {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3) !important;
}

.pf-v5-c-dropdown__menu-item,
.pf-c-dropdown__menu-item,
.pf-v5-c-menu__item,
.pf-c-menu__item {
    color: var(--text-primary) !important;
}

.pf-v5-c-dropdown__menu-item:hover,
.pf-c-dropdown__menu-item:hover,
.pf-v5-c-menu__item:hover,
.pf-c-menu__item:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

/* Modals */
.pf-v5-c-modal-box,
.pf-c-modal-box {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
}

.pf-v5-c-modal-box__header,
.pf-c-modal-box__header {
    background: transparent !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.pf-v5-c-modal-box__title,
.pf-c-modal-box__title {
    color: var(--text-primary) !important;
}

/* Links */
a {
    color: var(--primary-color) !important;
    text-decoration: none !important;
}

a:hover {
    color: var(--primary-hover) !important;
}

/* Description lists */
.pf-v5-c-description-list__term,
.pf-c-description-list__term {
    color: var(--text-secondary) !important;
}

.pf-v5-c-description-list__description,
.pf-c-description-list__description {
    color: var(--text-primary) !important;
}

/* Empty states */
.pf-v5-c-empty-state,
.pf-c-empty-state {
    color: var(--text-secondary) !important;
}

/* Progress bars */
.pf-v5-c-progress__bar,
.pf-c-progress__bar {
    background: var(--primary-color) !important;
}

/* Switches */
.pf-v5-c-switch__input:checked ~ .pf-v5-c-switch__toggle,
.pf-c-switch__input:checked ~ .pf-c-switch__toggle {
    background: var(--primary-color) !important;
}

.pf-v5-c-switch__toggle,
.pf-c-switch__toggle {
    background: var(--border-color) !important;
}

/* Checkboxes */
.pf-v5-c-check__input:checked ~ .pf-v5-c-check__label::before,
.pf-c-check__input:checked ~ .pf-c-check__label::before {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

/* Select dropdowns */
.pf-v5-c-select__toggle,
.pf-c-select__toggle {
    background: var(--input-bg) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
}

.pf-v5-c-select__menu,
.pf-c-select__menu {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
}

/* Data lists */
.pf-v5-c-data-list__item,
.pf-c-data-list__item {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    margin-bottom: 10px !important;
    border-radius: 8px !important;
}

/* Breadcrumbs */
.pf-v5-c-breadcrumb__link,
.pf-c-breadcrumb__link {
    color: var(--primary-color) !important;
}

/* Avatars */
.pf-v5-c-avatar,
.pf-c-avatar {
    background: var(--primary-color) !important;
}

/* Badges/Labels */
.pf-v5-c-badge,
.pf-c-badge,
.pf-v5-c-label,
.pf-c-label {
    background: rgba(0, 167, 93, 0.1) !important;
    color: var(--primary-color) !important;
    border: 1px solid var(--primary-color) !important;
}

/* Text content */
.pf-v5-c-content,
.pf-c-content,
p {
    color: var(--text-primary) !important;
}

/* Helper text */
.pf-v5-c-helper-text,
.pf-c-helper-text {
    color: var(--text-secondary) !important;
}

/* Jump links */
.pf-v5-c-jump-links__link,
.pf-c-jump-links__link {
    color: var(--text-secondary) !important;
}

.pf-v5-c-jump-links__link.pf-m-current,
.pf-c-jump-links__link.pf-m-current {
    color: var(--primary-color) !important;
}

/* Toolbar */
.pf-v5-c-toolbar,
.pf-c-toolbar {
    background: transparent !important;
}

/* Override white backgrounds */
[class*="pf-u-background-color-100"],
[class*="pf-v5-u-background-color-100"],
.pf-m-white,
.bg-white {
    background: var(--bg-secondary) !important;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4a4a4a;
}

/* Ensure text readability */
* {
    color: inherit;
}

/* Fix specific PatternFly v5 components */
.pf-v5-c-form-control.pf-m-disabled,
.pf-c-form-control.pf-m-disabled {
    background: var(--border-color) !important;
    opacity: 0.6 !important;
}

/* Remove any inline styles that might interfere */
[style*="background: rgb(255, 255, 255)"],
[style*="background-color: rgb(255, 255, 255)"] {
    background: var(--bg-secondary) !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .pf-v5-c-page__main-section,
    .pf-c-page__main-section {
        padding: 20px !important;
    }
}
