/* GEDCOM Family Tree - Main Styles */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
}

/* Global border removal */
* {
    box-sizing: border-box;
    border: none !important;
    outline: none !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f8f9fa;
}

/* Navbar Customization */
#system-navbar {
    font-size: 0.9rem;
}

#system-navbar .nav-link {
    padding: 0.25rem 0.75rem;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.5rem;
}

/* Vertical alignment for navigation */
.navbar-nav .nav-link {
    display: flex;
    align-items: center;
}

/* Breadcrumb vertical alignment */
.breadcrumb {
    display: flex;
    align-items: center;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item + .breadcrumb-item::before {
    display: flex;
    align-items: center;
    padding-top: 0;
    padding-bottom: 0;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255,255,255,0.85);
    transition: color 0.2s;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link.active {
    color: #fff;
}

.navbar-dark .navbar-nav .nav-link i {
    margin-right: 0.25rem;
    display: inline-flex;
    align-items: center;
}

/* Card Enhancements */
.card {
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}

.card-header {
    background-color: #fff;
    font-weight: 600;
}

/* Buttons */
.btn {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn i {
    margin-right: 0.25rem;
}

/* DataTables Customization */
.dataTables_wrapper .dataTables_filter input {
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
    margin-left: 0.5rem;
    background-color: #f8f9fa;
}

.dataTables_wrapper .dataTables_length select {
    border-radius: 0.375rem;
    padding: 0.375rem 2rem 0.375rem 0.75rem;
    background-color: #f8f9fa;
}

/* Name column - prevent wrapping */
table.dataTable td:first-child {
    white-space: nowrap;
    min-width: 200px;
}

table.dataTable th:first-child {
    white-space: nowrap;
    min-width: 200px;
}

table.dataTable thead th {
    font-weight: 600;
    background-color: #0d6efd !important;
    color: #fff !important;
}

table.dataTable tbody tr:hover td {
    background-color: #fffbeb !important;
}

table.dataTable tbody tr:hover {
    cursor: pointer;
}

table.dataTable tbody tr.private-row:hover td {
    background-color: #f1f3f5 !important;
}

table.dataTable tbody tr.private-row:hover {
    cursor: default;
}

/* DataTable Sorting Indicators */
table.dataTable thead th.sorting,
table.dataTable thead th.sorting_asc,
table.dataTable thead th.sorting_desc {
    color: #fff !important;
}

table.dataTable thead th.sorting::before,
table.dataTable thead th.sorting::after,
table.dataTable thead th.sorting_asc::before,
table.dataTable thead th.sorting_asc::after,
table.dataTable thead th.sorting_desc::before,
table.dataTable thead th.sorting_desc::after {
    color: #fff !important;
    opacity: 0.7;
}

/* Forms */
.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #495057;
}

/* Alerts */
.alert {
    border-radius: 0.5rem;
    padding: 1rem 1.5rem;
}

.alert-dismissible .btn-close {
    padding: 1.25rem 1.5rem;
}

/* Footer */
footer {
    margin-top: auto;
}

/* Loading Spinner */
.spinner-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Badge Customization */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

.badge.bg-warning.text-dark {
    background-color: #ffc107 !important;
    color: #000 !important;
}

/* Deceased Icon Styling */
.deceased-icon {
    color: #6c757d;
    cursor: help;
}

[data-bs-theme="dark"] .deceased-icon {
    color: #adb5bd;
}

/* Timeline Styles */
.timeline {
    position: relative;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dee2e6;
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
    box-shadow: 0 0 0 3px #fff, 0 0 0 6px #dee2e6;
    transform: translateX(-50%);
}

/* Individual/Family Cards */
.person-card.male {
    background: linear-gradient(to right, #0d6efd 4px, transparent 4px);
}

.person-card.female {
    background: linear-gradient(to right, #d63384 4px, transparent 4px);
}

.person-card.unknown {
    background: linear-gradient(to right, var(--secondary-color) 4px, transparent 4px);
}

/* Image Gallery */
.media-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1rem 0;
}

.media-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.media-item:hover {
    transform: scale(1.05);
}

.media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Breadcrumbs */
.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    font-size: 1.2em;
}

/* Main container breadcrumbs */
#main-container .bg-light {
    background-color: #f8f9fa !important;
}

#main-container .border {
    border-color: #dee2e6 !important;
}

/* Sticky Navbars */
body {
    padding-top: 0;
}

/* Scroll to Top Button */
#scrollToTop {
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

#scrollToTop:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

/* Dark Mode Support */
[data-bs-theme="dark"] body.dark-mode {
    background-color: #1a1d20;
    color: #e9ecef;
}

[data-bs-theme="dark"] #system-navbar {
    background-color: #000 !important;
}

[data-bs-theme="dark"] .navbar-dark {
    background-color: #0a0c0d !important;
}

[data-bs-theme="dark"] .card {
    background-color: #212529;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

[data-bs-theme="dark"] .card-body {
    color: #fff;
}

[data-bs-theme="dark"] .card-header {
    background-color: #2b3035;
    color: #fff;
}

[data-bs-theme="dark"] .card-title {
    color: #fff !important;
}

[data-bs-theme="dark"] .card-text {
    color: #e9ecef;
}

[data-bs-theme="dark"] .bg-light {
    background-color: #212529 !important;
}

[data-bs-theme="dark"] footer {
    background-color: #212529 !important;
}

[data-bs-theme="dark"] .modal-content {
    background-color: #212529;
    color: #e9ecef;
}

[data-bs-theme="dark"] .modal-header {
    background-color: #2b3035;
    color: #fff;
}

[data-bs-theme="dark"] .modal-footer {
    background-color: #2b3035;
}

[data-bs-theme="dark"] .modal-title {
    color: #fff;
}

[data-bs-theme="dark"] .close,
[data-bs-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

[data-bs-theme="dark"] .table {
    color: #e9ecef;
    background-color: #212529;
}

[data-bs-theme="dark"] .table thead {
    background-color: #2b3035;
    color: #ffffff;
}

[data-bs-theme="dark"] .table thead th {
    background-color: #2b3035 !important;
    color: #ffffff !important;
    border-color: #495057 !important;
}

[data-bs-theme="dark"] .table tbody {
    background-color: #212529;
    color: #e9ecef;
}

[data-bs-theme="dark"] .table tbody td {
    color: #e9ecef !important;
    border-color: #495057 !important;
}

[data-bs-theme="dark"] .table tbody tr {
    background-color: #212529;
}

[data-bs-theme="dark"] .table tbody tr:hover {
    background-color: #2b3035 !important;
}

[data-bs-theme="dark"] .table tbody tr:hover td {
    background-color: #2b3035 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .table.table-hover tbody tr:hover {
    background-color: #2b3035 !important;
}

[data-bs-theme="dark"] .table.table-hover tbody tr:hover td {
    background-color: #2b3035 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .table.table-sm {
    font-size: 0.875rem;
}

[data-bs-theme="dark"] .table.table-sm td,
[data-bs-theme="dark"] .table.table-sm th {
    padding: 0.5rem;
}

[data-bs-theme="dark"] .table code {
    background-color: #3d4347;
    color: #6ea8fe;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
}

[data-bs-theme="dark"] .table .badge {
    color: #ffffff;
}

[data-bs-theme="dark"] .table .small {
    color: #adb5bd;
}

[data-bs-theme="dark"] .table-light {
    background-color: #2b3035 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .table-light thead {
    background-color: #343a40 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .table-light thead th {
    background-color: #343a40 !important;
    color: #ffffff !important;
    border-color: #495057 !important;
}

[data-bs-theme="dark"] .table-danger {
    background-color: #5c1a1a !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .table-danger td {
    background-color: #5c1a1a !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .table-warning {
    background-color: #664d03 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .table-warning td {
    background-color: #664d03 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] table.dataTable thead th {
    background-color: #0d6efd !important;
    color: #fff !important;
}

[data-bs-theme="dark"] table.dataTable thead th.sorting,
[data-bs-theme="dark"] table.dataTable thead th.sorting_asc,
[data-bs-theme="dark"] table.dataTable thead th.sorting_desc {
    color: #fff !important;
}

[data-bs-theme="dark"] table.dataTable thead th.sorting::before,
[data-bs-theme="dark"] table.dataTable thead th.sorting::after,
[data-bs-theme="dark"] table.dataTable thead th.sorting_asc::before,
[data-bs-theme="dark"] table.dataTable thead th.sorting_asc::after,
[data-bs-theme="dark"] table.dataTable thead th.sorting_desc::before,
[data-bs-theme="dark"] table.dataTable thead th.sorting_desc::after {
    color: #fff !important;
    opacity: 0.7;
}

[data-bs-theme="dark"] table.dataTable tbody tr:hover td {
    background-color: #5a4a1a !important;
}

[data-bs-theme="dark"] table.dataTable tbody tr:hover {
    cursor: pointer;
}

[data-bs-theme="dark"] table.dataTable tbody tr.private-row:hover td {
    background-color: #3d4347 !important;
}

[data-bs-theme="dark"] table.dataTable tbody tr.private-row:hover {
    cursor: default;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #3d4347;
    color: #fff;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: #4a5156;
    color: #fff;
}

[data-bs-theme="dark"] .form-check-input {
    background-color: #3d4347;
}

[data-bs-theme="dark"] .form-check-input:checked {
    background-color: #0d6efd;
}

[data-bs-theme="dark"] .form-check-label {
    color: #e9ecef;
}

[data-bs-theme="dark"] small,
[data-bs-theme="dark"] .small {
    color: #adb5bd;
}

[data-bs-theme="dark"] .text-muted {
    color: #adb5bd !important;
}

[data-bs-theme="dark"] .text-primary {
    color: #6ea8fe !important;
}

[data-bs-theme="dark"] .text-secondary {
    color: #adb5bd !important;
}

[data-bs-theme="dark"] .text-success {
    color: #75b798 !important;
}

[data-bs-theme="dark"] .text-danger {
    color: #ea868f !important;
}

[data-bs-theme="dark"] .text-warning {
    color: #ffca2c !important;
}

[data-bs-theme="dark"] .text-info {
    color: #6edff6 !important;
}

[data-bs-theme="dark"] .text-dark {
    color: #adb5bd !important;
}

[data-bs-theme="dark"] .dropdown-menu {
    background-color: #2b3035;
}

[data-bs-theme="dark"] .dropdown-item {
    color: #e9ecef;
}

[data-bs-theme="dark"] .dropdown-item:hover {
    background-color: #3d4347;
    color: #fff;
}

[data-bs-theme="dark"] .dropdown-header {
    color: #adb5bd;
}

/* DataTables Dark Theme */
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_length,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_filter,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_info,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate {
    color: #fff !important;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_length label,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_filter label {
    color: #fff !important;
    font-weight: 500;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_info {
    color: #adb5bd !important;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_filter input,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_length select {
    background-color: #3d4347 !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button {
    background-color: #3d4347 !important;
    color: #e9ecef !important;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background-color: #4a5156 !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.current,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background-color: #0d6efd !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    color: #6c757d !important;
}

/* General Dark Theme Improvements */
[data-bs-theme="dark"] body {
    background-color: #1a1d20 !important;
    color: #e9ecef !important;
}

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

[data-bs-theme="dark"] label,
[data-bs-theme="dark"] .form-label {
    color: #fff !important;
}

[data-bs-theme="dark"] p {
    color: #e9ecef;
}

[data-bs-theme="dark"] a {
    color: #6ea8fe;
}

[data-bs-theme="dark"] a:hover {
    color: #9ec5fe;
}

[data-bs-theme="dark"] .btn-outline-primary {
    color: #6ea8fe;
    background-color: transparent;
}

[data-bs-theme="dark"] .btn-outline-primary:hover {
    color: #fff;
    background-color: #0d6efd;
}

[data-bs-theme="dark"] .btn-outline-secondary {
    color: #adb5bd;
    background-color: transparent;
}

[data-bs-theme="dark"] .btn-outline-secondary:hover {
    color: #fff;
    background-color: #6c757d;
}

[data-bs-theme="dark"] .btn-outline-danger {
    color: #ea868f;
    background-color: transparent;
}

[data-bs-theme="dark"] .btn-outline-danger:hover {
    color: #fff;
    background-color: #dc3545;
}

[data-bs-theme="dark"] .table tbody tr {
    background-color: transparent;
    color: #fff;
}

[data-bs-theme="dark"] .table tbody td {
    color: #fff;
}

[data-bs-theme="dark"] .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] table.dataTable tbody td {
    color: #fff !important;
}

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

[data-bs-theme="dark"] .badge {
    background-color: #3d4347;
    color: #e9ecef;
}

[data-bs-theme="dark"] .badge.bg-success {
    background-color: #198754 !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .badge.bg-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
}

[data-bs-theme="dark"] .badge.bg-warning.text-dark {
    color: #000 !important;
}

[data-bs-theme="dark"] .badge.bg-danger {
    background-color: #dc3545 !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .badge.bg-info {
    background-color: #0dcaf0 !important;
    color: #000 !important;
}

[data-bs-theme="dark"] .badge.bg-secondary {
    background-color: #6c757d !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .btn-group .btn {
    color: #e9ecef;
}

[data-bs-theme="dark"] .list-group-item {
    background-color: #2b3035;
    color: #e9ecef;
}

[data-bs-theme="dark"] .list-group-item:hover {
    background-color: #3d4347;
}

[data-bs-theme="dark"] .alert {
    background-color: #3d4347;
    color: #e9ecef;
}

[data-bs-theme="dark"] .breadcrumb {
    background-color: transparent;
}

[data-bs-theme="dark"] .breadcrumb-item,
[data-bs-theme="dark"] .breadcrumb-item a {
    color: #adb5bd;
}

[data-bs-theme="dark"] .breadcrumb-item.active {
    color: #e9ecef;
}

[data-bs-theme="dark"] #main-container .bg-light {
    background-color: #2b3035 !important;
}

[data-bs-theme="dark"] #main-container .border {
    border-color: #3d4347 !important;
}

/* Timeline Dark Theme */
[data-bs-theme="dark"] .timeline::before {
    background: #4a5156;
}

[data-bs-theme="dark"] .timeline-item::before {
    background: #0d6efd;
    box-shadow: 0 0 0 3px #212529, 0 0 0 6px #4a5156;
}

[data-bs-theme="dark"] .timeline-content {
    color: #e9ecef;
}

/* Button Improvements */
[data-bs-theme="dark"] .btn-primary {
    background-color: #0d6efd;
    color: #fff;
}

[data-bs-theme="dark"] .btn-secondary {
    background-color: #6c757d;
    color: #fff;
}

[data-bs-theme="dark"] .btn-success {
    background-color: #198754;
    color: #fff;
}

[data-bs-theme="dark"] .btn-danger {
    background-color: #dc3545;
    color: #fff;
}

[data-bs-theme="dark"] .btn-warning {
    background-color: #ffc107;
    color: #000;
}

[data-bs-theme="dark"] .btn-info {
    background-color: #0dcaf0;
    color: #000;
}

/* Toast Notifications */
[data-bs-theme="dark"] .toast {
    background-color: #212529;
    color: #e9ecef;
}

[data-bs-theme="dark"] .toast-header {
    background-color: #2b3035;
    color: #fff;
}

/* Person Cards */
[data-bs-theme="dark"] .person-card.male {
    background: linear-gradient(to right, #0d6efd 4px, #212529 4px);
}

[data-bs-theme="dark"] .person-card.female {
    background: linear-gradient(to right, #d63384 4px, #212529 4px);
}

[data-bs-theme="dark"] .person-card.unknown {
    background: linear-gradient(to right, #6c757d 4px, #212529 4px);
}

/* Table Improvements */
[data-bs-theme="dark"] .table-borderless tbody tr {
    background-color: transparent;
}

[data-bs-theme="dark"] .table-borderless th,
[data-bs-theme="dark"] .table-borderless td {
    color: #e9ecef;
}

/* Navbar Improvements */
[data-bs-theme="dark"] .navbar-brand {
    color: #fff !important;
}

[data-bs-theme="dark"] .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
}

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

/* Boxed Layout */
.container.boxed-layout {
    max-width: 1400px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .timeline::before {
        left: 20px;
    }
    
    .timeline-item::before {
        left: 20px;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    footer,
    .no-print {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
    }
    
    a[href]:after {
        content: none;
    }
}

/* Toast Notifications - Centered */
#appToast {
    min-width: 350px;
    max-width: 500px;
    box-shadow: 0 0.5rem 1.5rem rgba(0,0,0,0.3);
    border-radius: 0.5rem;
}

#appToast .toast-body {
    padding: 1rem 1.5rem;
    font-size: 1rem;
}

#appToast #toastTitle {
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.25rem;
}

#appToast #toastMessage {
    font-size: 0.95rem;
}

/* Utility Classes */
.hover-shadow:hover {
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15) !important;
}

.cursor-pointer {
    cursor: pointer;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

/* Media Card Improvements - Fixed Button Position */
.media-card .card-body {
    display: flex !important;
    flex-direction: column !important;
}

.media-card .flex-shrink-0 {
    flex-shrink: 0 !important;
}

/* Ensure buttons are always visible */
.media-card .btn-group {
    min-width: fit-content;
}

/* Principal Person Overlay on Thumbnail */
.media-card .position-absolute.bottom-0.start-0 {
    transition: all 0.2s ease;
}

.media-card:hover .position-absolute.bottom-0.start-0 {
    background-color: rgba(0, 0, 0, 0.1);
}

.media-card .position-absolute.bottom-0.start-0 .badge {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}

.media-card:hover .position-absolute.bottom-0.start-0 .badge {
    background-color: rgba(0, 0, 0, 0.85) !important;
}

/* Dark theme support for principal person overlay */
[data-bs-theme="dark"] .media-card .position-absolute.bottom-0.start-0 .badge {
    background-color: rgba(255, 255, 255, 0.2) !important;
}

[data-bs-theme="dark"] .media-card:hover .position-absolute.bottom-0.start-0 .badge {
    background-color: rgba(255, 255, 255, 0.3) !important;
}

/* Remove text decorations and clean up buttons */
a {
    text-decoration: none !important;
}

a:hover {
    text-decoration: none !important;
}

.btn {
    text-decoration: none !important;
    box-shadow: none !important;
}

.btn:hover,
.btn:focus,
.btn:active {
    text-decoration: none !important;
    box-shadow: none !important;
}

.btn-sm {
    padding: 0.25rem 0.5rem !important;
}

/* Remove default link underlines in nav and cards */
.nav-link,
.navbar-brand,
.card a,
.dropdown-item {
    text-decoration: none !important;
}

.breadcrumb-item a {
    text-decoration: none !important;
}

/* Visual feedback for form controls without borders */
.form-control,
.form-select {
    background-color: #f8f9fa;
}

.form-control:focus,
.form-select:focus {
    background-color: #fff;
}

/* Crop Modal - Larger and More Accessible */
#cropModal .modal-dialog {
    max-width: 95vw !important;
    width: 95vw;
    margin: 1rem auto;
}

#cropModal .modal-body {
    padding: 2rem !important;
}

/* Cropper.js - Larger Handles for Easier Manipulation */
.cropper-view-box {
    outline: 2px solid #0d6efd;
    outline-color: rgba(13, 110, 253, 0.75);
}

.cropper-point {
    width: 12px !important;
    height: 12px !important;
    background-color: #0d6efd !important;
    opacity: 1 !important;
    border: 2px solid #fff !important;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3) !important;
}

.cropper-point:hover {
    background-color: #0a58ca !important;
    transform: scale(1.2);
}

.cropper-line {
    background-color: #0d6efd !important;
    opacity: 0.6 !important;
}

.cropper-line:hover {
    opacity: 1 !important;
}

/* Make edge lines thicker for easier grabbing */
.cropper-line.line-e,
.cropper-line.line-w {
    width: 4px !important;
}

.cropper-line.line-n,
.cropper-line.line-s {
    height: 4px !important;
}

/* Better visibility for crop box */
.cropper-crop-box {
    outline: 2px solid #0d6efd;
}

/* Darker background for uncropped area */
.cropper-bg {
    background-image: none;
    background-color: rgba(0, 0, 0, 0.5);
}

/* Crop container */
.cropper-container {
    background-color: #f8f9fa;
    max-height: 80vh !important;
}

/* Dark theme support for cropper */
[data-bs-theme="dark"] .cropper-container {
    background-color: #212529;
}

[data-bs-theme="dark"] .cropper-bg {
    background-color: rgba(0, 0, 0, 0.7);
}

/* ============================================
   DARK MODE - ENHANCED CONTRAST IMPROVEMENTS
   ============================================ */

/* Dark Mode - Enhanced Text Contrast */
[data-bs-theme="dark"] body {
    background-color: #1a1d20 !important;
    color: #e9ecef !important;
}

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

[data-bs-theme="dark"] p,
[data-bs-theme="dark"] .lead {
    color: #e9ecef !important;
}

/* Dark Mode - Cards and Containers */
[data-bs-theme="dark"] .card-header.bg-white {
    background-color: #2b3035 !important;
    color: #ffffff !important;
    border-bottom-color: #495057 !important;
}

[data-bs-theme="dark"] .card.shadow-sm {
    background-color: #212529 !important;
    border-color: #495057 !important;
    color: #e9ecef !important;
}

/* Dark Mode - Forms */
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .form-control {
    background-color: #3d4347 !important;
    color: #ffffff !important;
    border-color: #495057 !important;
}

[data-bs-theme="dark"] .form-select:focus,
[data-bs-theme="dark"] .form-control:focus {
    background-color: #4a5156 !important;
    color: #ffffff !important;
    border-color: #6ea8fe !important;
    box-shadow: 0 0 0 0.2rem rgba(110, 168, 254, 0.25) !important;
}

[data-bs-theme="dark"] .form-label {
    color: #e9ecef !important;
}

/* Dark Mode - Buttons */
[data-bs-theme="dark"] .btn-primary {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .btn-primary:hover {
    background-color: #0b5ed7 !important;
    border-color: #0a58ca !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .btn-danger {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .btn-danger:hover {
    background-color: #bb2d3b !important;
    border-color: #b02a37 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .btn-outline-danger {
    border-color: #dc3545 !important;
    color: #dc3545 !important;
}

[data-bs-theme="dark"] .btn-outline-danger:hover {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #ffffff !important;
}

/* Dark Mode - Statistics Cards */
[data-bs-theme="dark"] .card.bg-danger,
[data-bs-theme="dark"] .card.bg-warning,
[data-bs-theme="dark"] .card.bg-info,
[data-bs-theme="dark"] .card.bg-secondary {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .card.bg-danger .text-white-50,
[data-bs-theme="dark"] .card.bg-warning .text-white-50,
[data-bs-theme="dark"] .card.bg-info .text-white-50,
[data-bs-theme="dark"] .card.bg-secondary .text-white-50 {
    color: rgba(255, 255, 255, 0.75) !important;
}

[data-bs-theme="dark"] .card.bg-danger h3,
[data-bs-theme="dark"] .card.bg-warning h3,
[data-bs-theme="dark"] .card.bg-info h3,
[data-bs-theme="dark"] .card.bg-secondary h3 {
    color: #ffffff !important;
}

/* Dark Mode - Logs Table Enhanced Contrast */
[data-bs-theme="dark"] .table-responsive {
    background-color: #212529;
}

[data-bs-theme="dark"] .table tbody tr td code {
    background-color: #3d4347 !important;
    color: #6ea8fe !important;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

[data-bs-theme="dark"] .table tbody tr:hover td code {
    background-color: #495057 !important;
    color: #8bb4ff !important;
}

[data-bs-theme="dark"] .log-message {
    color: #e9ecef !important;
}

[data-bs-theme="dark"] .table tbody tr:hover .log-message {
    color: #ffffff !important;
}

