/* Navigation Sign Up Button Fix */
.navbar .nav-link.btn.btn-primary,
.navbar .nav-link.btn.btn-primary.text-white {
    --bs-nav-link-color: #ffffff !important;
    --bs-btn-color: #ffffff !important;
    --bs-btn-bg: #0d6efd !important;
    --bs-btn-border-color: #0d6efd !important;
    color: #ffffff !important;
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
}

.navbar .nav-link.btn.btn-primary:hover,
.navbar .nav-link.btn.btn-primary.text-white:hover {
    --bs-nav-link-hover-color: #ffffff !important;
    --bs-btn-hover-color: #ffffff !important;
    --bs-btn-hover-bg: #0b5ed7 !important;
    --bs-btn-hover-border-color: #0a58ca !important;
    color: #ffffff !important;
    background-color: #0b5ed7 !important;
    border-color: #0a58ca !important;
}

/* Dark Mode Styles */
body {
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

html {
    overflow-x: hidden;
}

body.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
}

body.dark-mode .container-fluid {
    background-color: #121212;
}

/* Navigation Dark Mode */
body.dark-mode .navbar {
    background-color: #1e1e1e !important;
}

body.dark-mode .navbar-brand {
    color: #ffffff !important;
}

body.dark-mode .nav-link {
    color: #e0e0e0 !important;
}

body.dark-mode .nav-link:hover {
    color: #ffffff !important;
}

body.dark-mode .navbar-toggler {
    border-color: #444;
}

body.dark-mode .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='m4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Hero Section Dark Mode */
.lakely-header-bg {
    background: linear-gradient(135deg, #0b5fdd, #05285d);
    color: white;
}

body.dark-mode .lakely-header-bg {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: #ffffff;
}

/* How It Works Section Dark Mode */
body.dark-mode .how-it-works-section {
    background: #1a1a1a;
}

body.dark-mode .how-it-works-card {
    background: #2d2d2d;
    border: 1px solid #404040;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

body.dark-mode .how-it-works-card:hover {
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

body.dark-mode .how-it-works-title {
    color: #ffffff;
}

body.dark-mode .how-it-works-description {
    color: #b0b0b0;
}

body.dark-mode .feature-item {
    color: #d0d0d0;
}

body.dark-mode .how-it-works-icon {
    background: linear-gradient(135deg, #2a2a3e, #1e1e32);
}

body.dark-mode .how-it-works-cta {
    background: linear-gradient(135deg, #2a2a2a, #1e1e1e);
}

body.dark-mode .how-it-works-cta h4 {
    color: #ffffff;
}

/* Organization Spotlight Dark Mode */
body.dark-mode .org-spotlight-section {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

body.dark-mode .spotlight-card {
    background: #2d2d2d;
    border: 1px solid #404040;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

body.dark-mode .spotlight-card:hover {
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

body.dark-mode .spotlight-title {
    color: #ffffff;
}

body.dark-mode .spotlight-excerpt {
    color: #b0b0b0;
}

body.dark-mode .stat-item {
    background: #3a3a3a;
    color: #d0d0d0;
}

body.dark-mode .stat-item:hover {
    background: #454545;
}

body.dark-mode .empty-spotlight {
    color: #b0b0b0;
}

/* MLR Support Strip Dark Mode */
body.dark-mode .bg-light {
    background-color: #2d2d2d !important;
}

body.dark-mode .border-bottom {
    border-color: #404040 !important;
}

body.dark-mode .mlr-text h6 {
    color: #ffffff;
}

body.dark-mode .mlr-text p {
    color: #b0b0b0;
}

body.dark-mode .text-muted {
    color: #b0b0b0 !important;
}

body.dark-mode .small.text-muted {
    color: #b0b0b0 !important;
}

/* Join Network Modal Dark Mode */
body.dark-mode .modal-content {
    background-color: #2d2d2d;
    border: 1px solid #404040;
}

body.dark-mode .modal-header {
    border-bottom: 1px solid #404040;
}

body.dark-mode .modal-title {
    color: #ffffff;
}

body.dark-mode .modal-body {
    color: #e0e0e0;
}

body.dark-mode .join-option-card {
    background: #3a3a3a;
    border: 1px solid #505050;
}

body.dark-mode .join-option-card:hover {
    background: #454545;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.dark-mode .join-option-card .card-body {
    color: #e0e0e0;
}

body.dark-mode .join-option-card h5 {
    color: #ffffff;
}

/* Footer Dark Mode */
body.dark-mode footer.bg-dark {
    background-color: #1a1a1a !important;
    border-top: 1px solid #404040;
}

/* Button Dark Mode */
body.dark-mode .btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

body.dark-mode .btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

body.dark-mode .btn-outline-primary {
    color: #0d6efd;
    border-color: #0d6efd;
}

body.dark-mode .btn-outline-primary:hover {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #ffffff;
}

body.dark-mode .btn-spotlight {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #ffffff;
}

body.dark-mode .btn-spotlight:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
    color: #ffffff;
}

/* General text colors for dark mode */
body.dark-mode h1, body.dark-mode h2, body.dark-mode h3, 
body.dark-mode h4, body.dark-mode h5, body.dark-mode h6 {
    color: #ffffff;
}

body.dark-mode p {
    color: #e0e0e0;
}

body.dark-mode .text-muted {
    color: #b0b0b0 !important;
}

/* Dark mode toggle button */
.dark-mode-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background: #0d6efd;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

/* Add smooth transitions to key elements */
.container-fluid,
.card,
.navbar,
.modal-content,
.form-control,
.btn,
.alert,
.list-group-item,
.dropdown-menu {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.dark-mode-toggle:hover {
    background: #0b5ed7;
    transform: scale(1.1);
}

body.dark-mode .dark-mode-toggle {
    background: #ffc107;
    color: #000;
}

body.dark-mode .dark-mode-toggle:hover {
    background: #ffca2c;
}

/* Universal Dark Mode Styles for All Pages */

/* Cards and Content Areas */
body.dark-mode .card {
    background-color: #2d2d2d;
    border: 1px solid #404040;
    color: #e0e0e0;
}

body.dark-mode .card-header {
    background-color: #3a3a3a;
    border-bottom: 1px solid #404040;
    color: #ffffff;
}

body.dark-mode .card-body {
    color: #e0e0e0;
}

body.dark-mode .card-title {
    color: #ffffff;
}

body.dark-mode .card-text {
    color: #d0d0d0;
}

/* Tables */
body.dark-mode .table {
    color: #e0e0e0;
    background-color: #2d2d2d;
}

body.dark-mode .table th {
    background-color: #3a3a3a;
    border-color: #404040;
    color: #ffffff;
}

body.dark-mode .table td {
    background-color: #2d2d2d;
    border-color: #404040;
    color: #d0d0d0;
}

body.dark-mode .table-bordered {
    border: 1px solid #404040;
}

body.dark-mode .table-responsive {
    background-color: #2d2d2d;
}

/* Table Striped Rows - Darker Background for Dark Mode */
body.dark-mode .table-striped > tbody > tr:nth-of-type(odd) > td,
body.dark-mode .table-striped > tbody > tr:nth-of-type(odd) > th {
    background-color: #252525;
}

body.dark-mode .table-striped > tbody > tr:nth-of-type(even) > td,
body.dark-mode .table-striped > tbody > tr:nth-of-type(even) > th {
    background-color: #2d2d2d;
}

/* Navigation Tabs */
body.dark-mode .nav-tabs {
    border-bottom: 1px solid #404040;
}

body.dark-mode .nav-tabs .nav-link {
    color: #b0b0b0;
    background-color: #2d2d2d;
    border: 1px solid #404040;
}

body.dark-mode .nav-tabs .nav-link:hover {
    color: #ffffff;
    background-color: #3a3a3a;
    border-color: #505050;
}

body.dark-mode .nav-tabs .nav-link.active {
    color: #ffffff;
    background-color: #0d6efd;
    border-color: #0d6efd;
}

body.dark-mode .tab-content {
    background-color: #2d2d2d;
    border: 1px solid #404040;
    border-top: none;
    padding: 1rem;
}

/* Breadcrumbs */
body.dark-mode .breadcrumb {
    background-color: transparent;
}

body.dark-mode .breadcrumb-item a {
    color: #ffffff;
    text-decoration: underline;
}

body.dark-mode .breadcrumb-item.active {
    color: #e0e0e0;
}

/* Forms */
body.dark-mode .form-control {
    background-color: #3a3a3a;
    border: 1px solid #505050;
    color: #ffffff;
}

body.dark-mode .form-control:focus {
    background-color: #404040;
    border-color: #0d6efd;
    color: #ffffff;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

body.dark-mode .form-select {
    background-color: #3a3a3a;
    border: 1px solid #505050;
    color: #ffffff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e");
}

body.dark-mode .form-select:focus {
    background-color: #404040;
    border-color: #0d6efd;
    color: #ffffff;
}

body.dark-mode .form-label {
    color: #e0e0e0;
}

body.dark-mode .form-check-input {
    background-color: #3a3a3a;
    border: 1px solid #505050;
}

body.dark-mode .form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

body.dark-mode .form-check-label {
    color: #e0e0e0;
}

/* Button Groups */
body.dark-mode .btn-group .btn-outline-primary {
    color: #0d6efd;
    border-color: #0d6efd;
    background-color: transparent;
}

body.dark-mode .btn-group .btn-outline-primary:hover {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #ffffff;
}

body.dark-mode .btn-check:checked + .btn-outline-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #ffffff;
}

/* Links */
body.dark-mode a {
    color: #4dabf7;
}

body.dark-mode a:hover {
    color: #74c0fc;
}

body.dark-mode .btn-link {
    color: #4dabf7;
}

body.dark-mode .btn-link:hover {
    color: #74c0fc;
}

/* Badges */
body.dark-mode .badge {
    color: #ffffff;
}

body.dark-mode .badge.bg-danger {
    background-color: #dc3545 !important;
}

body.dark-mode .badge.bg-success {
    background-color: #198754 !important;
}

body.dark-mode .badge.bg-warning {
    background-color: #ffc107 !important;
    color: #000000 !important;
}

body.dark-mode .badge.bg-info {
    background-color: #0dcaf0 !important;
    color: #000000 !important;
}

/* Alerts */
body.dark-mode .alert {
    border: 1px solid #404040;
}

body.dark-mode .alert-primary {
    background-color: #1e3a5f;
    border-color: #2c5aa0;
    color: #b8daff;
}

body.dark-mode .alert-success {
    background-color: #1e4d3a;
    border-color: #2d7a4f;
    color: #b8f5d1;
}

body.dark-mode .alert-danger {
    background-color: #5d1a1a;
    border-color: #842029;
    color: #f5c2c7;
}

body.dark-mode .alert-warning {
    background-color: #664d03;
    border-color: #997404;
    color: #ffecb5;
}

body.dark-mode .alert-info {
    background-color: #1a3a52;
    border-color: #2c5a7a;
    color: #b8e7ff;
}

/* List Groups */
body.dark-mode .list-group-item {
    background-color: #2d2d2d;
    border: 1px solid #404040;
    color: #e0e0e0;
}

body.dark-mode .list-group-item:hover {
    background-color: #3a3a3a;
}

body.dark-mode .list-group-item.active {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #ffffff;
}

/* Pagination */
body.dark-mode .page-link {
    background-color: #2d2d2d;
    border: 1px solid #404040;
    color: #4dabf7;
}

body.dark-mode .page-link:hover {
    background-color: #3a3a3a;
    border-color: #505050;
    color: #74c0fc;
}

body.dark-mode .page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #ffffff;
}

body.dark-mode .page-item.disabled .page-link {
    background-color: #2d2d2d;
    border-color: #404040;
    color: #6c757d;
}

/* Dropdowns */
body.dark-mode .dropdown-menu {
    background-color: #2d2d2d;
    border: 1px solid #404040;
}

body.dark-mode .dropdown-item {
    color: #e0e0e0;
}

body.dark-mode .dropdown-item:hover {
    background-color: #3a3a3a;
    color: #ffffff;
}

body.dark-mode .dropdown-divider {
    border-top: 1px solid #404040;
}

/* Progress Bars */
body.dark-mode .progress {
    background-color: #3a3a3a;
}

body.dark-mode .progress-bar {
    background-color: #0d6efd;
}

/* Tooltips and Popovers */
body.dark-mode .tooltip-inner {
    background-color: #2d2d2d;
    color: #ffffff;
}

body.dark-mode .popover {
    background-color: #2d2d2d;
    border: 1px solid #404040;
}

body.dark-mode .popover-header {
    background-color: #3a3a3a;
    border-bottom: 1px solid #404040;
    color: #ffffff;
}

body.dark-mode .popover-body {
    color: #e0e0e0;
}

/* Accordion */
body.dark-mode .accordion-item {
    background-color: #2d2d2d;
    border: 1px solid #404040;
}

body.dark-mode .accordion-header .accordion-button {
    background-color: #3a3a3a;
    color: #ffffff;
    border: none;
}

body.dark-mode .accordion-header .accordion-button:not(.collapsed) {
    background-color: #0d6efd;
    color: #ffffff;
}

body.dark-mode .accordion-body {
    background-color: #2d2d2d;
    color: #e0e0e0;
}

/* Offcanvas */
body.dark-mode .offcanvas {
    background-color: #2d2d2d;
    color: #e0e0e0;
}

body.dark-mode .offcanvas-header {
    border-bottom: 1px solid #404040;
}

body.dark-mode .offcanvas-title {
    color: #ffffff;
}

/* Canvas and Chart Areas */
body.dark-mode canvas {
    background-color: #2d2d2d;
}

/* Specific Page Elements */
body.dark-mode .about-section {
    color: #e0e0e0;
}

body.dark-mode .water-quality-section {
    color: #e0e0e0;
}

/* Display headings in dark mode */
body.dark-mode .display-1,
body.dark-mode .display-2,
body.dark-mode .display-3,
body.dark-mode .display-4,
body.dark-mode .display-5,
body.dark-mode .display-6 {
    color: #ffffff;
}

/* Ensure proper contrast for small text */
body.dark-mode .fs-6,
body.dark-mode .small {
    color: #b0b0b0;
}

/* Button outline variants for dark mode */
body.dark-mode .btn-outline-light {
    color: #ffffff;
    border-color: #ffffff;
}

body.dark-mode .btn-outline-light:hover {
    background-color: #ffffff;
    border-color: #ffffff;
    color: #000000;
}

/* Ensure icons maintain proper colors */
body.dark-mode .fas,
body.dark-mode .far,
body.dark-mode .fab {
    color: inherit;
}

/* Map container dark mode */
body.dark-mode .leaflet-map,
body.dark-mode .leaflet-map-large {
    border: 1px solid #404040;
}

/* Fix white flash in dark mode maps */
body.dark-mode .leaflet-container {
    background-color: #2d2d2d !important;
}

body.dark-mode .leaflet-tile-pane {
    background-color: #2d2d2d !important;
}

body.dark-mode .leaflet-map-pane {
    background-color: #2d2d2d !important;
}

/* Ensure map tiles load smoothly in dark mode */
body.dark-mode .leaflet-tile {
    /* Removed transition to prevent flickering on mouse events */
}

/* Dark mode map controls */
body.dark-mode .leaflet-control-zoom {
    background-color: #2d2d2d !important;
    border: 1px solid #404040 !important;
    border-radius: 4px !important;
}

body.dark-mode .leaflet-control-zoom a {
    background-color: #2d2d2d !important;
    border-color: #404040 !important;
    color: #e0e0e0 !important;
    opacity: 1 !important;
}

body.dark-mode .leaflet-control-zoom a:hover {
    background-color: #3a3a3a !important;
    color: #ffffff !important;
}

body.dark-mode .leaflet-control-zoom a:first-child {
    border-bottom: 1px solid #404040 !important;
}

body.dark-mode .leaflet-control-attribution {
    background-color: rgba(45, 45, 45, 0.8) !important;
    color: #e0e0e0 !important;
}

body.dark-mode .leaflet-control-attribution a {
    color: #4dabf7 !important;
}

/* Dark mode popup styling */
body.dark-mode .leaflet-popup-content-wrapper {
    background-color: #2d2d2d !important;
    color: #e0e0e0 !important;
    border: 1px solid #404040 !important;
}

body.dark-mode .leaflet-popup-tip {
    background-color: #2d2d2d !important;
    border: 1px solid #404040 !important;
}

body.dark-mode .leaflet-popup-content {
    color: #e0e0e0 !important;
}

body.dark-mode .leaflet-popup-content a {
    color: #4dabf7 !important;
}

body.dark-mode .leaflet-popup-content a:hover {
    color: #74c0fc !important;
}

/* Mobile touch improvements for map markers */
.leaflet-marker-icon,
.leaflet-marker-shadow {
    /* Ensure markers are touchable on mobile */
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

.leaflet-popup-content a {
    /* Improve touch targets for popup links */
    min-height: 44px;
    display: inline-block;
    padding: 8px 12px;
    text-decoration: underline;
    transition: all 0.2s ease;
}

.leaflet-popup-content a:hover,
.leaflet-popup-content a:focus {
    text-decoration: none;
}

/* Improve touch targets for mobile devices */
@media (max-width: 768px) {
    .leaflet-marker-icon {
        /* Increase touch target size on mobile */
        min-width: 32px !important;
        min-height: 32px !important;
    }
    
    .leaflet-popup-content a {
        /* Larger touch targets on mobile */
        min-height: 48px;
        padding: 12px 16px;
        font-size: 16px;
    }
    
    .leaflet-popup-content {
        /* Better spacing on mobile */
        font-size: 14px;
        line-height: 1.4;
    }
}

/* Hero Section Button Spacing on Mobile */
@media (max-width: 576px) {
    .lakely-header-bg .btn {
        display: block;
        width: 100%;
        margin-bottom: 0.75rem;
    }
    
    .lakely-header-bg .btn:last-child {
        margin-bottom: 0;
    }
    
    .lakely-header-bg .btn.me-3 {
        margin-right: 0 !important;
    }
}

/* Mobile Navigation Menu Improvements */
@media (max-width: 991px) {
    .navbar-collapse {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    
    .navbar-nav .nav-item {
        margin-bottom: 0.5rem;
    }
    
    .navbar-nav .nav-link.btn.btn-primary {
        margin-left: 0 !important;
        margin-top: 0.5rem;
        padding: 0.5rem 1rem;
        text-align: center;
        display: block;
        width: 100%;
        max-width: 200px;
    }
    
    .navbar-nav .nav-item:last-child {
        margin-bottom: 0;
    }
}

/* Responsive adjustments for dark mode toggle on mobile */
@media (max-width: 768px) {
    .dark-mode-toggle {
        bottom: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    .dark-mode-toggle {
        bottom: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

.leaflet-map {
    height: 400px;
    border-radius: 5px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

.leaflet-map-large {
    height: 600px;
    border-radius: 5px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

.legend-container {
    background: white;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    font-size: 14px;
    border: 1px solid #ccc;
}

/* Dark mode legend container */
body.dark-mode .legend-container {
    background: #2d2d2d !important;
    border: 1px solid #404040 !important;
    color: #e0e0e0 !important;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5) !important;
}

.popup-readings {
    max-height: 150px;
    overflow-y: auto;
}

/* Search functionality styles */
.search-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 5px 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
}

.search-result-item {
    color: #212529 !important; /* Ensure dark text color */
}

.search-result-item .fw-bold {
    color: #212529 !important; /* Ensure dark text for lake names */
}

.search-result-item .text-muted {
    color: #6c757d !important; /* Ensure proper muted text color */
}

.search-result-item:hover {
    background-color: #f8f9fa;
}

.search-result-item:last-child {
    border-bottom: none !important;
}

/* Dark mode search styles */
body.dark-mode .search-results {
    background: #2d2d2d;
    border: 1px solid #404040;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

body.dark-mode .search-result-item {
    color: #e0e0e0 !important;
    border-bottom: 1px solid #404040;
}

body.dark-mode .search-result-item .fw-bold {
    color: #ffffff !important;
}

body.dark-mode .search-result-item .text-muted {
    color: #b0b0b0 !important;
}

body.dark-mode .search-result-item:hover {
    background-color: #3a3a3a;
}

#homepage-map {
    height: 400px;
    border-radius: 5px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    margin-top: 20px;
}

/* Organization Navigation Styles */
.org-nav-toc {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.org-nav-toc h5 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #dee2e6;
}

.org-nav-list li {
    line-height: 1.6;
    position: relative;
}

.org-nav-list li::before {
    content: "▸";
    color: #6c757d;
    font-weight: bold;
    position: absolute;
    left: -1rem;
}

.org-nav-list li ul li::before {
    content: "◦";
    color: #adb5bd;
    left: -0.8rem;
}

.org-nav-list a {
    color: #0d6efd;
    transition: color 0.2s ease;
}

.org-nav-list a:hover {
    color: #0b5ed7;
    text-decoration: underline;
}

.org-nav-list strong {
    color: #0d6efd;
    font-weight: 600;
}

.org-nav-list .text-muted {
    color: #6c757d !important;
    font-weight: 500;
}

/* Dark mode organization navigation */
body.dark-mode .org-nav-toc {
    background-color: #2d2d2d;
    border: 1px solid #404040;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

body.dark-mode .org-nav-toc h5 {
    color: #ffffff;
    border-bottom: 2px solid #404040;
}

body.dark-mode .org-nav-list li::before {
    color: #b0b0b0;
}

body.dark-mode .org-nav-list li ul li::before {
    color: #808080;
}

body.dark-mode .org-nav-list a {
    color: #4dabf7;
}

body.dark-mode .org-nav-list a:hover {
    color: #74c0fc;
}

body.dark-mode .org-nav-list strong {
    color: #4dabf7;
}

body.dark-mode .org-nav-list .text-muted {
    color: #b0b0b0 !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .org-nav-toc {
        padding: 1rem;
        margin: 0 0.5rem;
    }
    
    .org-nav-list li::before {
        left: -0.8rem;
    }
    
    .org-nav-list li ul li::before {
        left: -0.6rem;
    }
}

/* Organization Page Management Styles */
.page-management-form .section-header h6 {
    color: #495057;
    font-weight: 600;
}

.page-management-form .page-item {
    border-bottom: 1px solid #dee2e6;
}

.page-management-form .page-item:last-child {
    border-bottom: none;
}

.page-management-form .page-info h6 {
    color: #212529;
}

.page-management-form .page-info p {
    color: #6c757d;
}

.page-management-form .bg-info {
    background-color: rgba(13, 202, 240, 0.1) !important;
}

.page-management-form .border-info {
    border-color: #0dcaf0 !important;
}

.page-management-form .text-info {
    color: #0dcaf0 !important;
}

.page-management-form .badge.bg-info {
    background-color: #0dcaf0 !important;
    color: #000 !important;
}

/* Dark mode organization page management */
body.dark-mode .page-management-form .section-header h6 {
    color: #ffffff;
}

body.dark-mode .page-management-form .page-item {
    border-bottom: 1px solid #404040;
}

body.dark-mode .page-management-form .page-info h6 {
    color: #ffffff;
}

body.dark-mode .page-management-form .page-info p {
    color: #b0b0b0;
}

body.dark-mode .page-management-form .bg-info {
    background-color: rgba(13, 202, 240, 0.2) !important;
}

body.dark-mode .page-management-form .border-info {
    border-color: #0dcaf0 !important;
}

body.dark-mode .page-management-form .text-info {
    color: #17a2b8 !important;
}

body.dark-mode .page-management-form .badge.bg-info {
    background-color: #0dcaf0 !important;
    color: #000 !important;
}

body.dark-mode .page-management-form .badge.bg-secondary {
    background-color: #6c757d !important;
    color: #ffffff !important;
}

body.dark-mode .page-management-form .badge.bg-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
}

/* Form switches in dark mode */
body.dark-mode .form-check-input {
    background-color: #3a3a3a;
    border: 1px solid #505050;
}

body.dark-mode .form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

body.dark-mode .form-check-input:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

body.dark-mode .form-check-input:disabled {
    background-color: #2d2d2d;
    border-color: #404040;
}

body.dark-mode .form-check-label {
    color: #e0e0e0;
}

body.dark-mode .form-check-label.text-muted {
    color: #b0b0b0 !important;
}

/* Organization Edit Pages Dark Mode */
body.dark-mode .section-editor-container {
    background-color: #2d2d2d;
    border: 1px solid #404040;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

body.dark-mode .section-header h3 {
    color: #ffffff;
}

body.dark-mode .section-controls .form-check-label {
    color: #e0e0e0;
}

body.dark-mode .section-controls .form-check-label.text-muted {
    color: #b0b0b0 !important;
}

body.dark-mode .section-controls small.text-muted {
    color: #b0b0b0 !important;
}

body.dark-mode .section-editor {
    background-color: #2d2d2d;
    border: 1px solid #404040;
    border-radius: 8px;
    padding: 1.5rem;
}

body.dark-mode .section-disabled-message {
    color: #b0b0b0;
}

body.dark-mode .section-disabled-message p {
    color: #b0b0b0;
}

/* Edit Mode Header Dark Mode */
body.dark-mode .bg-warning {
    background-color: rgba(255, 193, 7, 0.2) !important;
}

body.dark-mode .border-warning {
    border-color: #ffc107 !important;
}

body.dark-mode .text-warning {
    color: #ffc107 !important;
}

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

/* Gallery Section Dark Mode */
body.dark-mode .gallery-section {
    background-color: #2d2d2d;
}

body.dark-mode .gallery-section p.text-muted {
    color: #b0b0b0 !important;
}

body.dark-mode .gallery-dropzone,
body.dark-mode #gallery-dropzone,
body.dark-mode [id^="gallery-dropzone-"] {
    background-color: #3a3a3a;
    border: 2px dashed #4dabf7;
    color: #e0e0e0;
}

body.dark-mode .gallery-dropzone:hover,
body.dark-mode #gallery-dropzone:hover,
body.dark-mode [id^="gallery-dropzone-"]:hover {
    background-color: #404040;
    border-color: #74c0fc;
}

body.dark-mode .gallery-dropzone.dz-drag-hover,
body.dark-mode #gallery-dropzone.dz-drag-hover,
body.dark-mode [id^="gallery-dropzone-"].dz-drag-hover {
    background-color: rgba(40, 167, 69, 0.2);
    border-color: #28a745;
}

body.dark-mode .dz-message {
    color: #e0e0e0;
}

body.dark-mode .dz-message small {
    color: #b0b0b0;
}

body.dark-mode .gallery-item {
    background: #3a3a3a;
    border: 1px solid #505050;
}

body.dark-mode .gallery-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

body.dark-mode .image-title {
    color: #ffffff;
}

body.dark-mode .image-description {
    color: #b0b0b0;
}

body.dark-mode .gallery-empty {
    color: #b0b0b0;
}

body.dark-mode .gallery-empty h4 {
    color: #ffffff;
}

body.dark-mode .gallery-empty i {
    color: #808080;
}

/* Messages Container Dark Mode */
body.dark-mode .messages-container .alert {
    border: 1px solid #404040;
}

/* Disabled Sections Alert Dark Mode */
body.dark-mode .persistent-alert {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d2d2d 100%) !important;
    border: 1px solid #404040 !important;
}

body.dark-mode .persistent-alert h6 {
    color: #ffffff !important;
}

body.dark-mode .persistent-alert p {
    color: #b0b0b0 !important;
}

body.dark-mode .persistent-alert .text-info {
    color: #17a2b8 !important;
}

body.dark-mode .persistent-alert .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Timeline Editor Dark Mode */
body.dark-mode .timeline-editor {
    background-color: #2d2d2d;
    border: 1px solid #404040;
}

body.dark-mode .timeline-item {
    background-color: #3a3a3a;
    border: 1px solid #505050;
}

body.dark-mode .timeline-item:hover {
    background-color: #404040;
}

body.dark-mode .timeline-item h5 {
    color: #ffffff;
}

body.dark-mode .timeline-item p {
    color: #d0d0d0;
}

body.dark-mode .timeline-item .text-muted {
    color: #b0b0b0 !important;
}

/* Prose Editor Dark Mode */
body.dark-mode .prose-editor {
    background-color: #3a3a3a;
    border: 1px solid #505050;
    color: #ffffff;
}

body.dark-mode .prose-editor:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

body.dark-mode .prose-editor .trix-content {
    color: #ffffff;
}

body.dark-mode .prose-editor .trix-button-group {
    background-color: #2d2d2d;
    border: 1px solid #404040;
}

body.dark-mode .prose-editor .trix-button {
    background-color: #3a3a3a;
    border: 1px solid #505050;
    color: #e0e0e0;
}

body.dark-mode .prose-editor .trix-button:hover {
    background-color: #404040;
}

body.dark-mode .prose-editor .trix-button.trix-active {
    background-color: #0d6efd;
    color: #ffffff;
}

/* Section Form Dark Mode */
body.dark-mode .section-form {
    background-color: #2d2d2d;
}

body.dark-mode .section-form .form-label {
    color: #e0e0e0;
}

body.dark-mode .section-form .form-text {
    color: #b0b0b0;
}

/* Button Group Dark Mode for Edit Pages */
body.dark-mode .btn-group .btn-outline-secondary {
    color: #6c757d;
    border-color: #6c757d;
    background-color: transparent;
}

body.dark-mode .btn-group .btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #ffffff;
}

/* Edit Page Specific Elements */
body.dark-mode .edit-image-btn {
    background-color: rgba(13, 110, 253, 0.1);
    border-color: #0d6efd;
    color: #4dabf7;
}

body.dark-mode .edit-image-btn:hover {
    background-color: #0d6efd;
    color: #ffffff;
}

body.dark-mode .delete-image-btn {
    background-color: rgba(220, 53, 69, 0.1);
    border-color: #dc3545;
    color: #ff6b7a;
}

body.dark-mode .delete-image-btn:hover {
    background-color: #dc3545;
    color: #ffffff;
}

/* TipTap/ProseMirror Editor Dark Mode */
body.dark-mode .prose-editor-container {
    background-color: #2d2d2d;
    border: 1px solid #404040;
    border-radius: 8px;
}

body.dark-mode .prose-editor {
    background-color: #3a3a3a;
    border: 1px solid #505050;
    color: #ffffff;
}

body.dark-mode .tiptap.ProseMirror {
    background-color: #3a3a3a;
    color: #ffffff;
    border: none;
    padding: 1rem;
}

body.dark-mode .tiptap.ProseMirror h1,
body.dark-mode .tiptap.ProseMirror h2,
body.dark-mode .tiptap.ProseMirror h3,
body.dark-mode .tiptap.ProseMirror h4,
body.dark-mode .tiptap.ProseMirror h5,
body.dark-mode .tiptap.ProseMirror h6 {
    color: #ffffff;
}

body.dark-mode .tiptap.ProseMirror p {
    color: #e0e0e0;
}

body.dark-mode .tiptap.ProseMirror ul,
body.dark-mode .tiptap.ProseMirror ol {
    color: #e0e0e0;
}

body.dark-mode .tiptap.ProseMirror li {
    color: #e0e0e0;
}

body.dark-mode .tiptap.ProseMirror blockquote {
    border-left: 4px solid #4dabf7;
    background-color: #2d2d2d;
    color: #d0d0d0;
}

body.dark-mode .tiptap.ProseMirror hr {
    border-color: #404040;
}

/* Prose Editor Menubar Dark Mode */
body.dark-mode .prose-menubar {
    background-color: #2d2d2d;
    border-bottom: 1px solid #404040;
    padding: 0.5rem;
}

body.dark-mode .prose-menubar__button {
    background-color: #3a3a3a;
    color: #e0e0e0;
    border: 1px solid #505050;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    margin: 0 0.125rem;
}

body.dark-mode .prose-menubar__button:hover {
    background-color: #404040;
    color: #ffffff;
}

body.dark-mode .prose-menubar__button.disabled {
    background-color: #2d2d2d;
    color: #6c757d;
    border-color: #404040;
}

body.dark-mode .prose-menubar__dropdown .prose-menubar__selected {
    background-color: #3a3a3a;
    border: 1px solid #505050;
    color: #e0e0e0;
}

body.dark-mode .prose-menubar__picker {
    background-color: #2d2d2d;
    border: 1px solid #404040;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.dark-mode .prose-menubar__picker .ProseMirror {
    background-color: #2d2d2d;
    color: #e0e0e0;
}

body.dark-mode .prose-menubar__picker h1,
body.dark-mode .prose-menubar__picker h2,
body.dark-mode .prose-menubar__picker h3,
body.dark-mode .prose-menubar__picker h4,
body.dark-mode .prose-menubar__picker h5,
body.dark-mode .prose-menubar__picker h6,
body.dark-mode .prose-menubar__picker p {
    color: #e0e0e0;
}

body.dark-mode .prose-menubar__picker [data-name]:hover {
    background-color: #3a3a3a;
}

/* Section Content Form Dark Mode */
body.dark-mode .section-content-form {
    background-color: #2d2d2d;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #404040;
}

body.dark-mode .section-content-form .form-group label {
    color: #e0e0e0;
    font-weight: 600;
}

body.dark-mode .editor-container {
    background-color: #3a3a3a;
    border: 1px solid #505050;
    border-radius: 8px;
}

body.dark-mode .loading-text {
    color: #b0b0b0;
    background-color: #2d2d2d;
    padding: 1rem;
    text-align: center;
}

/* Save Button Dark Mode */
body.dark-mode .save-section-btn {
    background-color: #198754;
    border-color: #198754;
    color: #ffffff;
}

body.dark-mode .save-section-btn:hover {
    background-color: #157347;
    border-color: #146c43;
}

/* Text Info Icons Dark Mode */
body.dark-mode .text-info {
    color: #17a2b8 !important;
}

body.dark-mode .fas.text-info {
    color: #17a2b8 !important;
}

/* Hidden Textarea Dark Mode */
body.dark-mode textarea[name="content"] {
    background-color: #3a3a3a;
    color: #ffffff;
    border: 1px solid #505050;
}

/* Material Icons Dark Mode */
body.dark-mode .material-icons {
    color: inherit;
}

/* Prose Editor Group Styling */
body.dark-mode .prose-menubar__group {
    border-right: 1px solid #404040;
    padding-right: 0.5rem;
    margin-right: 0.5rem;
}

body.dark-mode .prose-menubar__group:last-child {
    border-right: none;
}

/* Form Labels and Help Text */
body.dark-mode .form-group label {
    color: #e0e0e0;
}

body.dark-mode .form-text {
    color: #b0b0b0;
}

body.dark-mode .help-text {
    color: #b0b0b0;
}

/* Section Editor Specific Styling */
body.dark-mode .section-editor.section-disabled {
    opacity: 0.6;
    background-color: #1a1a1a;
}

body.dark-mode .section-disabled-message {
    background-color: #2d2d2d;
    border: 1px solid #404040;
    border-radius: 8px;
    padding: 2rem;
}

body.dark-mode .section-disabled-message p {
    color: #b0b0b0;
    margin: 0;
}

/* Prose Editor Initialization State */
body.dark-mode .prose-editor-initialized {
    background-color: #3a3a3a;
    border: 1px solid #505050;
}

body.dark-mode .prose-editor-container.initialized {
    background-color: #3a3a3a;
}

/* Additional TipTap Styling */
body.dark-mode .ProseMirror-focused {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

body.dark-mode .ProseMirror-selectednode {
    outline: 2px solid #4dabf7;
}

/* Link Styling in Editor */
body.dark-mode .tiptap.ProseMirror a {
    color: #4dabf7;
}

body.dark-mode .tiptap.ProseMirror a:hover {
    color: #74c0fc;
}

/* Code Blocks if Present */
body.dark-mode .tiptap.ProseMirror code {
    background-color: #2d2d2d;
    color: #e0e0e0;
    border: 1px solid #404040;
    padding: 0.125rem 0.25rem;
    border-radius: 4px;
}

body.dark-mode .tiptap.ProseMirror pre {
    background-color: #2d2d2d;
    color: #e0e0e0;
    border: 1px solid #404040;
    padding: 1rem;
    border-radius: 8px;
}

/* Image Compression Progress Styles */
.trix-attachment {
    position: relative;
}

.trix-attachment--processing {
    opacity: 0.7;
}

.trix-attachment--processing::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.compression-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 0 0 4px 4px;
    z-index: 10;
}

.compression-progress.success {
    background: rgba(40, 167, 69, 0.9);
}

.compression-progress.error {
    background: rgba(220, 53, 69, 0.9);
}

/* Trix editor image attachment styles */
.trix-attachment__caption-editor {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
}

.trix-attachment__caption-editor:focus {
    background: rgba(0, 0, 0, 0.8);
    outline: none;
}

/* Loading spinner for image compression */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.compression-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

/* Trix Figure and Caption Styling */
.trix-content figure.attachment {
    max-width: 800px;
    margin: 1.5rem auto;
    text-align: center;
}

.trix-content figure.attachment img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
}

.trix-content figure.attachment img:hover {
    transform: scale(1.02);
}

.trix-content figure.attachment figcaption.attachment__caption {
    margin-top: 0.75rem;
    padding: 0.25rem 0;
    font-size: 0.9rem;
    color: #6c757d;
    font-style: italic;
    text-align: center;
}

.trix-content figure.attachment figcaption.attachment__caption .attachment__name {
    font-weight: 500;
    color: #495057;
    font-style: normal;
}

.trix-content figure.attachment figcaption.attachment__caption .attachment__size {
    font-size: 0.8rem;
    color: #adb5bd;
    margin-left: 0.5rem;
}

/* Responsive image sizing */
@media (max-width: 768px) {
    .trix-content figure.attachment {
        max-width: 100%;
        margin: 1rem 0;
    }
    
    .trix-content figure.attachment figcaption.attachment__caption {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
}

/* View mode content styling for images */
#view-content figure.attachment {
    max-width: 800px;
    margin: 1.5rem auto;
    text-align: center;
}

#view-content figure.attachment img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#view-content figure.attachment figcaption.attachment__caption {
    margin-top: 0.75rem;
    padding: 0.25rem 0;
    font-size: 0.9rem;
    color: #6c757d;
    font-style: italic;
    text-align: center;
}

#view-content figure.attachment figcaption.attachment__caption .attachment__name {
    font-weight: 500;
    color: #495057;
    font-style: normal;
}

#view-content figure.attachment figcaption.attachment__caption .attachment__size {
    font-size: 0.8rem;
    color: #adb5bd;
    margin-left: 0.5rem;
}

/* Gallery Styles */
.gallery-section {
    margin-top: 3rem;
    padding: 2rem 0;
    border-top: 1px solid #dee2e6;
}

.gallery-section h3 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Dropzone Styles */
#gallery-dropzone,
[id^="gallery-dropzone-"] {
    border: 2px dashed #007bff;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 2rem;
}

#gallery-dropzone:hover,
[id^="gallery-dropzone-"]:hover {
    border-color: #0056b3;
    background-color: #e9ecef;
}

#gallery-dropzone.dz-drag-hover,
[id^="gallery-dropzone-"].dz-drag-hover {
    border-color: #28a745;
    background-color: #d4edda;
}

.dz-message {
    font-size: 1.1rem;
    color: #6c757d;
    margin: 0;
}

.dz-preview {
    display: none !important;
}

/* Gallery Grid */
#gallery-images,
[id^="gallery-images-"] {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.gallery-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.image-wrapper {
    position: relative;
    overflow: hidden;
}

.gallery-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gallery-image:hover {
    transform: scale(1.05);
}

.image-controls {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.gallery-item:hover .image-controls {
    opacity: 1;
}

.image-controls .btn {
    padding: 4px 8px;
    font-size: 0.8rem;
}

.image-title {
    padding: 0.75rem 1rem 0.25rem;
    font-weight: 600;
    color: #495057;
    font-size: 0.95rem;
}

.image-description {
    padding: 0 1rem 0.75rem;
    color: #6c757d;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Lightbox Styles */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    cursor: pointer;
    padding: 20px;
    box-sizing: border-box;
}

.lightbox-content {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: -10px;
    right: -10px;
    background: rgba(0, 0, 0, 0.8);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    z-index: 10000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.lightbox-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Empty Gallery State */
.gallery-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.gallery-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #adb5bd;
}

.gallery-empty h4 {
    color: #495057;
    margin-bottom: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    #gallery-images,
    [id^="gallery-images-"] {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .gallery-image {
        height: 150px;
    }
    
    .lightbox-overlay {
        padding: 10px;
    }
    
    .lightbox-close {
        top: -5px;
        right: -5px;
        font-size: 1.2rem;
        width: 40px;
        height: 40px;
    }
    
    #gallery-dropzone,
    [id^="gallery-dropzone-"] {
        padding: 1.5rem 1rem;
    }
    
    .dz-message {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    #gallery-images,
    [id^="gallery-images-"] {
        grid-template-columns: 1fr;
    }
    
    .gallery-section {
        padding: 1.5rem 0;
    }
}

/* MLR Support Strip Styles */
.mlr-container {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: center;
    min-height: 60px;
}

.mlr-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0; /* Allow content to shrink */
}

.mlr-logo {
    height: 50px;
    width: auto;
    flex-shrink: 0;
}

.mlr-text {
    min-width: 0; /* Allow text to shrink */
}

.mlr-text h6 {
    color: #495057;
    font-size: 1rem;
    margin: 0 0 0.25rem 0;
    white-space: nowrap;
}

.mlr-text p {
    font-size: 0.875rem;
    line-height: 1.4;
    margin: 0;
}

.mlr-button {
    flex-shrink: 0;
}

.mlr-button .btn {
    white-space: nowrap;
    min-width: 160px;
}

/* Join Network Modal Styles */
.join-option-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #dee2e6;
}

.join-option-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.join-option-card .card-body {
    padding: 1.5rem 1rem;
}

.join-option-card i {
    color: #0d6efd;
}

/* Responsive adjustments for MLR strip */
@media (max-width: 992px) {
    .mlr-container {
        grid-template-columns: 1fr;
        gap: 1rem;
        text-align: center;
    }
    
    .mlr-content {
        justify-content: center;
    }
    
    .mlr-logo {
        height: 45px;
    }
    
    .mlr-text h6 {
        font-size: 0.95rem;
    }
    
    .mlr-text p {
        font-size: 0.8rem;
        line-height: 1.3;
    }
    
    .mlr-button .btn {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 768px) {
    .mlr-content {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .mlr-logo {
        height: 40px;
    }
    
    .mlr-text h6 {
        font-size: 0.9rem;
        white-space: normal;
    }
    
    .mlr-text p {
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .mlr-text h6 {
        font-size: 0.85rem;
    }
    
    .mlr-text p {
        font-size: 0.75rem;
    }
    
    .mlr-button .btn {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }
}

/* How It Works Section Styles */
.how-it-works-section {
    background: white;
    position: relative;
}

.how-it-works-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: visible;
    position: relative;
    padding: 2rem;
    text-align: center;
    margin-top: 25px;
}

.how-it-works-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
}

.step-number {
    position: absolute;
    top: -22px;
    right: 20px;
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #0d6efd, #0b5ed7);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.3rem;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
    line-height: 1;
    z-index: 10;
}

.how-it-works-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    transition: transform 0.3s ease;
}

.how-it-works-card:hover .how-it-works-icon {
    transform: scale(1.1);
}

.how-it-works-icon i {
    font-size: 2rem;
    color: #0d6efd;
}

.how-it-works-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.how-it-works-description {
    color: #6c757d;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.how-it-works-features {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    text-align: left;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: #495057;
}

.feature-item i {
    color: #28a745;
    font-size: 1rem;
    width: 16px;
    flex-shrink: 0;
}

.how-it-works-cta {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 16px;
    padding: 3rem 2rem;
    margin-top: 2rem;
}

.how-it-works-cta h4 {
    color: #212529;
    font-weight: 700;
}

.cta-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.cta-buttons .btn {
    flex: 0 0 auto;
    min-width: 200px;
}

/* Responsive Design for How It Works */
@media (max-width: 992px) {
    .how-it-works-card {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .how-it-works-icon {
        width: 70px;
        height: 70px;
    }
    
    .how-it-works-icon i {
        font-size: 1.75rem;
    }
    
    .how-it-works-title {
        font-size: 1.3rem;
    }
    
    .step-number {
        width: 35px;
        height: 35px;
        font-size: 1.1rem;
        top: -12px;
        right: 15px;
    }
}

@media (max-width: 768px) {
    .how-it-works-section {
        padding: 3rem 0;
    }
    
    .how-it-works-card {
        padding: 1.25rem;
    }
    
    .how-it-works-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 1rem;
    }
    
    .how-it-works-icon i {
        font-size: 1.5rem;
    }
    
    .how-it-works-title {
        font-size: 1.2rem;
    }
    
    .how-it-works-description {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }
    
    .how-it-works-cta {
        padding: 2rem 1.5rem;
    }
    
    .how-it-works-cta .btn {
        display: block;
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .how-it-works-cta .btn:last-child {
        margin-bottom: 0;
    }
    
    .step-number {
        width: 30px;
        height: 30px;
        font-size: 1rem;
        top: -10px;
        right: 10px;
    }
}

@media (max-width: 576px) {
    .how-it-works-features {
        gap: 0.5rem;
    }
    
    .feature-item {
        font-size: 0.85rem;
    }
    
    .how-it-works-cta {
        padding: 1.5rem 1rem;
    }
}

/* Organization Spotlight Styles */
.org-spotlight-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    position: relative;
}

.org-spotlight-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="%23ffffff" opacity="0.05"/><circle cx="10" cy="60" r="0.5" fill="%23ffffff" opacity="0.05"/><circle cx="90" cy="40" r="0.5" fill="%23ffffff" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.spotlight-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    position: relative;
}

.spotlight-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #0d6efd, #0b5ed7, #0a58ca);
}

.spotlight-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
}

.spotlight-card-header {
    padding: 2rem 2rem 1rem;
    text-align: center;
    position: relative;
}

.spotlight-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #0d6efd, #0b5ed7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: 0 8px 24px rgba(13, 110, 253, 0.3);
    transition: transform 0.3s ease;
}

.spotlight-card:hover .spotlight-icon {
    transform: scale(1.1);
}

.spotlight-icon i {
    font-size: 2rem;
    color: white;
}

.spotlight-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #212529;
    margin: 0;
    line-height: 1.3;
}

.spotlight-card-body {
    padding: 0 2rem 1.5rem;
}

.spotlight-excerpt {
    color: #6c757d;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    text-align: center;
}

.spotlight-stats {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #495057;
    transition: background-color 0.2s ease;
}

.stat-item:hover {
    background: #e9ecef;
}

.stat-item i {
    font-size: 1rem;
    width: 16px;
    text-align: center;
}

.spotlight-card-footer {
    padding: 0 2rem 2rem;
    text-align: center;
}

.btn-spotlight {
    padding: 0.75rem 2rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

.btn-spotlight:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(13, 110, 253, 0.3);
}

.empty-spotlight {
    padding: 4rem 2rem;
}

.empty-spotlight i {
    font-size: 4rem;
    display: block;
}

/* Responsive Design for Spotlight */
@media (max-width: 992px) {
    .spotlight-card-header,
    .spotlight-card-body,
    .spotlight-card-footer {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    .spotlight-icon {
        width: 70px;
        height: 70px;
    }
    
    .spotlight-icon i {
        font-size: 1.75rem;
    }
    
    .spotlight-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .org-spotlight-section {
        padding: 3rem 0;
    }
    
    .spotlight-card {
        margin-bottom: 2rem;
    }
    
    .spotlight-card-header,
    .spotlight-card-body,
    .spotlight-card-footer {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
    
    .spotlight-card-header {
        padding-top: 1.5rem;
    }
    
    .spotlight-card-footer {
        padding-bottom: 1.5rem;
    }
    
    .spotlight-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 1rem;
    }
    
    .spotlight-icon i {
        font-size: 1.5rem;
    }
    
    .spotlight-title {
        font-size: 1.2rem;
    }
    
    .spotlight-excerpt {
        font-size: 0.95rem;
    }
    
    .btn-spotlight {
        padding: 0.6rem 1.5rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 576px) {
    .spotlight-stats {
        gap: 0.5rem;
    }
    
    .stat-item {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .empty-spotlight {
        padding: 3rem 1rem;
    }
    
    .empty-spotlight i {
        font-size: 3rem;
    }
}

/* Organization Card Styles */
.hover-shadow {
    transition: box-shadow 0.3s ease;
}

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

/* Organization membership badge - light mode */
.org-membership-badge {
    background-color: #e7f3ff;
    color: #495057;
    border: 1px solid #b8daff;
}

.org-membership-link {
    color: #0066cc;
    font-weight: 500;
}

.org-membership-link:hover {
    color: #004499;
    text-decoration: underline !important;
}

/* Dark mode support for organization cards */
@media (prefers-color-scheme: dark) {
    body.dark-mode .org-membership-badge {
        background-color: #343a40;
        color: #f8f9fa;
        border-color: #495057;
    }
    
    body.dark-mode .org-membership-link {
        color: #6ea8fe;
    }
    
    body.dark-mode .org-membership-link:hover {
        color: #9ec5fe;
    }
}

/* Empty Content Message Styles */
.empty-content-message {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
}

body.dark-mode .empty-content-message {
    background-color: #2d2d2d;
    border: 1px solid #404040;
}

body.dark-mode .empty-content-message .text-muted {
    color: #b0b0b0 !important;
}

/* Organization Card Component Styles */
.org-card-link {
    display: flex;
    color: inherit;
    height: 100%;
}

.org-card {
    transition: all 0.3s ease;
    border: 1px solid var(--bs-border-color);
    background-color: var(--bs-body-bg);
    display: flex;
    flex-direction: column;
    position: relative;
}

.org-card-new-badge {
    position: absolute;
    top: -0.5rem;
    right: 1rem;
    z-index: 10;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.org-card .card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.org-card-link:hover .org-card {
    transform: translateY(-4px);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.15) !important;
    border-color: var(--bs-primary);
}

.org-card-action {
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-top: auto;
    padding-top: 1rem;
}

.org-card-link:hover .org-card-action {
    color: var(--bs-primary) !important;
}

.org-card-arrow {
    transition: transform 0.2s ease;
}

.org-card-link:hover .org-card-arrow {
    transform: translateX(4px);
}

/* Dark mode adjustments for org cards */
@media (prefers-color-scheme: dark) {
    .org-card-link:hover .org-card {
        box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.4) !important;
    }
}

body.dark-mode .org-card {
    border-color: var(--bs-border-color);
}

body.dark-mode .org-card-link:hover .org-card {
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.4) !important;
}

.org-card-footer {
    margin-top: auto;
    padding-top: 1rem;
}

.org-card-footer .badge {
    display: inline-block;
    line-height: 1.5;
    padding-top: 0;
    padding-bottom: 0;
}

.org-card-action {
    display: inline-block;
    line-height: 1.5;
    padding-top: 0;
}
