/* ================================================================
   BOOTSTRAP DARK THEME OVERRIDES
   Kompletny fix dla Bootstrap 5.3 do pełnego dark theme
   ================================================================ */

/* ================================================================
   GLOBAL OVERRIDES
   ================================================================ */

:root {
    color-scheme: dark;
}

body {
    color: #ffffff !important;
    background-color: rgba(0, 0, 0, 0.95) !important;
}

/* ================================================================
   BOOTSTRAP COMPONENT FIXES
   ================================================================ */

/* Text & Typography */
.text-body {
    color: #ffffff !important;
}

.text-muted {
    color: rgba(255, 255, 255, 0.65) !important;
}

.text-body-secondary {
    color: rgba(255, 255, 255, 0.7) !important;
}

.text-secondary {
    color: rgba(255, 255, 255, 0.85) !important;
}

/* Cards */
.card {
    background-color: rgba(15, 15, 30, 0.92) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

.card-header {
    background-color: rgba(25, 25, 40, 0.95) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.card-footer {
    background-color: rgba(25, 25, 40, 0.95) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.card-title {
    color: #ffffff !important;
}

.card-subtitle {
    color: rgba(255, 255, 255, 0.7) !important;
}

.card-text {
    color: rgba(255, 255, 255, 0.85) !important;
}

/* Alerts */
.alert {
    background-color: rgba(0, 0, 0, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

.alert-primary {
    background-color: rgba(0, 191, 255, 0.1) !important;
    border-color: rgba(0, 191, 255, 0.3) !important;
    color: #4dd9ff !important;
}

.alert-success {
    background-color: rgba(52, 199, 89, 0.1) !important;
    border-color: rgba(52, 199, 89, 0.3) !important;
    color: #34c759 !important;
}

.alert-warning {
    background-color: rgba(255, 204, 0, 0.1) !important;
    border-color: rgba(255, 204, 0, 0.3) !important;
    color: #ffcc00 !important;
}

.alert-danger {
    background-color: rgba(255, 59, 48, 0.1) !important;
    border-color: rgba(255, 59, 48, 0.3) !important;
    color: #ff3b30 !important;
}

.alert-info {
    background-color: rgba(124, 60, 237, 0.1) !important;
    border-color: rgba(124, 60, 237, 0.3) !important;
    color: #7c3aed !important;
}

/* Badges */
.badge {
    background-color: rgba(0, 191, 255, 0.2) !important;
    color: #4dd9ff !important;
}

.badge.bg-primary {
    background-color: rgba(0, 191, 255, 0.2) !important;
    color: #4dd9ff !important;
}

.badge.bg-secondary {
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: rgba(255, 255, 255, 0.85) !important;
}

.badge.bg-success {
    background-color: rgba(52, 199, 89, 0.2) !important;
    color: #34c759 !important;
}

.badge.bg-danger {
    background-color: rgba(255, 59, 48, 0.2) !important;
    color: #ff3b30 !important;
}

.badge.bg-warning {
    background-color: rgba(255, 204, 0, 0.2) !important;
    color: #ffcc00 !important;
}

.badge.bg-info {
    background-color: rgba(124, 60, 237, 0.2) !important;
    color: #7c3aed !important;
}

/* Buttons */
.btn {
    transition: all 250ms ease-out;
}

.btn-primary {
    background-color: #00bfff !important;
    border-color: #00bfff !important;
    color: #ffffff !important;
}

.btn-primary:hover {
    background-color: #4dd9ff !important;
    border-color: #4dd9ff !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 191, 255, 0.5) !important;
}

.btn-primary:focus,
.btn-primary:active {
    background-color: #0099cc !important;
    border-color: #0099cc !important;
    box-shadow: 0 0 0 3px rgba(0, 191, 255, 0.25) !important;
}

.btn-outline-primary {
    color: #00bfff !important;
    border-color: rgba(0, 191, 255, 0.5) !important;
}

.btn-outline-primary:hover {
    background-color: rgba(0, 191, 255, 0.15) !important;
    border-color: #00bfff !important;
    color: #ffffff !important;
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    color: #ffffff !important;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.25) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}

.btn-success {
    background-color: #34c759 !important;
    border-color: #34c759 !important;
}

.btn-success:hover {
    background-color: #45d76f !important;
    border-color: #45d76f !important;
}

.btn-danger {
    background-color: #ff3b30 !important;
    border-color: #ff3b30 !important;
}

.btn-danger:hover {
    background-color: #ff6b63 !important;
    border-color: #ff6b63 !important;
}

.btn-warning {
    background-color: #ffcc00 !important;
    border-color: #ffcc00 !important;
    color: #000000 !important;
}

.btn-warning:hover {
    background-color: #ffd60a !important;
    border-color: #ffd60a !important;
}

.btn-info {
    background-color: #7c3aed !important;
    border-color: #7c3aed !important;
    color: #ffffff !important;
}

.btn-info:hover {
    background-color: #9d4edd !important;
    border-color: #9d4edd !important;
}

/* Dropdowns */
.dropdown-menu {
    background-color: rgba(20, 20, 35, 0.95) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px);
}

.dropdown-item {
    color: rgba(255, 255, 255, 0.85) !important;
}

.dropdown-item:hover,
.dropdown-item.active,
.dropdown-item:focus {
    background-color: rgba(0, 191, 255, 0.15) !important;
    color: #4dd9ff !important;
}

.dropdown-header {
    color: rgba(255, 255, 255, 0.65) !important;
}

.dropdown-divider {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Forms */
.form-control,
.form-select,
textarea {
    background-color: rgba(25, 25, 40, 0.95) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

.form-control:focus,
.form-select:focus,
textarea:focus {
    background-color: rgba(30, 30, 50, 0.95) !important;
    border-color: rgba(0, 191, 255, 0.5) !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 0.25rem rgba(0, 191, 255, 0.25) !important;
}

.form-control::placeholder,
textarea::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

.form-check-input {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.form-check-input:checked {
    background-color: #00bfff !important;
    border-color: #00bfff !important;
}

.form-check-input:focus {
    border-color: #00bfff !important;
    box-shadow: 0 0 0 0.25rem rgba(0, 191, 255, 0.25) !important;
}

.form-label {
    color: rgba(255, 255, 255, 0.85) !important;
}

.form-text {
    color: rgba(255, 255, 255, 0.65) !important;
}

/* Navbars */
.navbar {
    background-color: rgba(0, 0, 0, 0.7) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.navbar-brand {
    color: #00bfff !important;
}

.navbar-brand:hover {
    color: #4dd9ff !important;
}

.nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
}

.nav-link:hover,
.nav-link.active {
    color: #4dd9ff !important;
}

/* Pagination */
.pagination .page-link {
    background-color: rgba(20, 20, 35, 0.95) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.85) !important;
}

.pagination .page-link:hover {
    background-color: rgba(0, 191, 255, 0.15) !important;
    border-color: rgba(0, 191, 255, 0.3) !important;
    color: #4dd9ff !important;
}

.pagination .page-link.active {
    background-color: #00bfff !important;
    border-color: #00bfff !important;
    color: #ffffff !important;
}

.pagination .page-link:disabled {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.4) !important;
}

/* Tables */
.table {
    color: rgba(255, 255, 255, 0.85) !important;
}

.table-dark {
    background-color: rgba(20, 20, 35, 0.95) !important;
}

.table>thead {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.table> :not(caption)>*>* {
    background-color: rgba(15, 15, 30, 0.95) !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
}

.table-hover>tbody>tr:hover {
    background-color: rgba(0, 191, 255, 0.1) !important;
}

.table-striped>tbody>tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

/* Modals */
.modal-content {
    background-color: rgba(10, 10, 20, 0.98) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.modal-header .btn-close {
    filter: invert(1) !important;
}

/* Tooltips & Popovers */
.tooltip-inner {
    background-color: rgba(0, 0, 0, 0.9) !important;
    color: #ffffff !important;
}

.popover {
    background-color: rgba(10, 10, 20, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.popover-header {
    background-color: rgba(20, 20, 35, 0.95) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

.popover-body {
    color: rgba(255, 255, 255, 0.85) !important;
}

/* Progress Bars */
.progress {
    background-color: rgba(255, 255, 255, 0.08) !important;
}

.progress-bar {
    background-color: #00bfff !important;
}

/* Lists */
.list-group-item {
    background-color: rgba(20, 20, 35, 0.95) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.85) !important;
}

.list-group-item:hover {
    background-color: rgba(30, 30, 50, 0.95) !important;
}

.list-group-item.active {
    background-color: #00bfff !important;
    border-color: #00bfff !important;
    color: #ffffff !important;
}

/* Breadcrumbs */
.breadcrumb {
    background-color: transparent !important;
}

.breadcrumb .breadcrumb-item {
    color: rgba(255, 255, 255, 0.65) !important;
}

.breadcrumb .breadcrumb-item.active {
    color: rgba(255, 255, 255, 0.85) !important;
}

.breadcrumb .breadcrumb-item a {
    color: #00bfff !important;
}

.breadcrumb .breadcrumb-item a:hover {
    color: #4dd9ff !important;
}

/* Spinners */
.spinner-border {
    border-color: rgba(255, 255, 255, 0.15) !important;
}

.spinner-border .spinner-border {
    border-color: #00bfff !important;
}

/* Misc */
.border {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.border-top {
    border-top-color: rgba(255, 255, 255, 0.1) !important;
}

.border-right {
    border-right-color: rgba(255, 255, 255, 0.1) !important;
}

.border-bottom {
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

.border-left {
    border-left-color: rgba(255, 255, 255, 0.1) !important;
}

.bg-light {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.bg-white {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

.bg-secondary {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Links */
a {
    color: #00bfff !important;
}

a:hover {
    color: #4dd9ff !important;
}

/* Code blocks */
code,
pre {
    background-color: rgba(0, 0, 0, 0.5) !important;
    color: #4dd9ff !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* DataTables dark theme */
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
    color: rgba(255, 255, 255, 0.85) !important;
}

.dataTables_wrapper .dataTables_info {
    color: rgba(255, 255, 255, 0.65) !important;
}

/* ================================================================
   ACCESSIBILITY
   ================================================================ */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus states for keyboard navigation */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #00bfff !important;
    outline-offset: 2px !important;
}

/* ================================================================
   PRINTING
   ================================================================ */

@media print {
    body {
        background-color: #ffffff !important;
        color: #000000 !important;
    }

    a {
        color: #0066cc !important;
    }

    .no-print {
        display: none !important;
    }
}