/* MJ-Org Custom Styles */

/* German typography improvements */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
}

/* Bootstrap overrides for German UI */
.navbar-brand {
    font-weight: 600;
}

/* Custom button styles */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
}

/* Card improvements */
.card {
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    transition: box-shadow 0.15s ease-in-out;
}

/* Jumbotron improvements */
.jumbotron {
    border-radius: 0.5rem;
}

/* HTMX indicators */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline;
}

.htmx-request.htmx-indicator {
    display: inline;
}

/* Form improvements */
.form-control:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Alert improvements */
.alert {
    border: none;
    border-radius: 0.5rem;
}

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

/* Responsive improvements */
@media (max-width: 768px) {
    .jumbotron {
        padding: 2rem 1rem;
    }
    
    .jumbotron h1 {
        font-size: 2rem;
    }
    
    .jumbotron .lead {
        font-size: 1rem;
    }
}

/* Mobile optimization for trip detail view - narrow viewports */
@media (max-width: 576px) {
    /* Remove container padding for mobile */
    .container {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    /* Make Reiseverlauf card use full width */
    .col-md-8 {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    /* Remove timeline item indentation for mobile */
    .timeline-item.ms-4 {
        margin-left: 0 !important;
    }
    
    /* Reduce card body padding for mobile */
    .card-body {
        padding: 0.75rem !important;
    }
    
    /* Reduce card header padding for mobile */
    .card-header {
        padding: 0.5rem 0.75rem !important;
    }
    
    /* Optimize timeline marker positioning */
    .timeline-marker {
        left: 0.5rem !important;
    }
    
    /* Reduce timeline content margin for mobile */
    .timeline-content {
        margin-left: 2.5rem !important;
    }
    
    /* Reduce button group spacing for mobile */
    .btn-group-sm .btn {
        padding: 0.25rem 0.5rem !important;
        font-size: 0.75rem !important;
    }
    
    /* Optimize breadcrumb for mobile */
    .breadcrumb {
        padding: 0.5rem 0 !important;
        margin-bottom: 1rem !important;
    }
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for keyboard navigation */
.btn:focus,
.form-control:focus,
.nav-link:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Dark Mode Support */
[data-bs-theme="dark"] {
    --bs-body-bg: #212529;
    --bs-body-color: #ffffff;
    --bs-emphasis-color: #fff;
    --bs-secondary-color: #ffffff;
    --bs-tertiary-color: #ffffff;
    --bs-border-color: #495057;
    --bs-border-color-translucent: rgba(255, 255, 255, 0.15);
    --bs-link-color: #6ea8fe;
    --bs-link-hover-color: #8bb9fe;
}

/* Dark mode specific overrides */
[data-bs-theme="dark"] .card {
    background-color: #212529 !important;
    border-color: #495057 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .card-header {
    background-color: #343a40 !important;
    border-bottom-color: #495057 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .card-footer {
    background-color: #343a40 !important;
    border-top-color: #495057 !important;
    color: #ffffff !important;
}

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

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

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

[data-bs-theme="dark"] .card-subtitle {
    color: #ffffff !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 {
    color: #ffffff !important;
}

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

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

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

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

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

[data-bs-theme="dark"] .dropdown-menu {
    background-color: #212529 !important;
    border-color: #495057 !important;
}

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

[data-bs-theme="dark"] .dropdown-item:hover {
    background-color: #343a40 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .dropdown-divider {
    border-color: #495057 !important;
}

[data-bs-theme="dark"] .modal-content {
    background-color: var(--bs-dark);
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .modal-header {
    border-bottom-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .modal-footer {
    border-top-color: var(--bs-border-color);
}

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

[data-bs-theme="dark"] .toast {
    background-color: var(--bs-dark);
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .toast-header {
    background-color: var(--bs-gray-800);
    border-bottom-color: var(--bs-border-color);
}

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

[data-bs-theme="dark"] .breadcrumb-item + .breadcrumb-item::before {
    color: var(--bs-secondary-color);
}

[data-bs-theme="dark"] .breadcrumb-item.active {
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .alert {
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .alert-info {
    background-color: rgba(13, 202, 240, 0.1);
    border-color: rgba(13, 202, 240, 0.2);
    color: #6ea8fe;
}

[data-bs-theme="dark"] .alert-success {
    background-color: rgba(25, 135, 84, 0.1);
    border-color: rgba(25, 135, 84, 0.2);
    color: #75b798;
}

[data-bs-theme="dark"] .alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.2);
    color: #ffda6a;
}

[data-bs-theme="dark"] .alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    border-color: rgba(220, 53, 69, 0.2);
    color: #f1aeb5;
}

/* Timeline dark mode styles */
[data-bs-theme="dark"] .timeline::before {
    background: #ffffff !important;
}

[data-bs-theme="dark"] .timeline-marker {
    background: #212529 !important;
    border-color: #ffffff !important;
}

[data-bs-theme="dark"] .timeline-card-stop {
    background-color: rgba(13, 110, 253, 0.2) !important;
    border-left-color: #0d6efd !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .timeline-card-voyage {
    background-color: rgba(25, 135, 84, 0.2) !important;
    border-left-color: #198754 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .timeline-card-event {
    background-color: rgba(13, 202, 240, 0.2) !important;
    border-left-color: #0dcaf0 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .timeline-card-ubernachtung {
    background-color: rgba(255, 193, 7, 0.2) !important;
    border-left-color: #ffc107 !important;
    color: #ffffff !important;
}

/* Timeline text elements dark mode - force all text to white */
[data-bs-theme="dark"] .timeline-card-stop,
[data-bs-theme="dark"] .timeline-card-stop *,
[data-bs-theme="dark"] .timeline-card-voyage,
[data-bs-theme="dark"] .timeline-card-voyage *,
[data-bs-theme="dark"] .timeline-card-event,
[data-bs-theme="dark"] .timeline-card-event *,
[data-bs-theme="dark"] .timeline-card-ubernachtung,
[data-bs-theme="dark"] .timeline-card-ubernachtung * {
    color: #ffffff !important;
}

/* Specific timeline text overrides */
[data-bs-theme="dark"] .timeline-card-stop .text-muted,
[data-bs-theme="dark"] .timeline-card-voyage .text-muted,
[data-bs-theme="dark"] .timeline-card-event .text-muted,
[data-bs-theme="dark"] .timeline-card-ubernachtung .text-muted,
[data-bs-theme="dark"] .timeline-card-stop small,
[data-bs-theme="dark"] .timeline-card-voyage small,
[data-bs-theme="dark"] .timeline-card-event small,
[data-bs-theme="dark"] .timeline-card-ubernachtung small,
[data-bs-theme="dark"] .timeline-card-stop strong,
[data-bs-theme="dark"] .timeline-card-voyage strong,
[data-bs-theme="dark"] .timeline-card-event strong,
[data-bs-theme="dark"] .timeline-card-ubernachtung strong {
    color: #ffffff !important;
}

/* Tickets container dark mode */
[data-bs-theme="dark"] .tickets-container {
    background-color: #343a40 !important;
    border-color: #495057 !important;
}

[data-bs-theme="dark"] .ticket-item {
    border-bottom-color: #495057 !important;
}

[data-bs-theme="dark"] .ticket-item a:hover {
    background-color: #495057 !important;
}

/* Trip header banner dark mode */
[data-bs-theme="dark"] .trip-header-banner::before {
    background: linear-gradient(to bottom, rgba(0,0,0,0.5), rgba(0,0,0,0.8));
}

/* Form controls dark mode */
[data-bs-theme="dark"] .form-control {
    background-color: #343a40 !important;
    border-color: #495057 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .form-control:focus {
    background-color: #343a40 !important;
    border-color: #86b7fe !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
    color: #ffffff !important;
}

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

[data-bs-theme="dark"] .form-select:focus {
    background-color: #343a40 !important;
    border-color: #86b7fe !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
    color: #ffffff !important;
}

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

[data-bs-theme="dark"] .form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
}

/* Table dark mode */
[data-bs-theme="dark"] .table {
    color: #ffffff !important;
}

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

[data-bs-theme="dark"] .table-hover > tbody > tr:hover > td,
[data-bs-theme="dark"] .table-hover > tbody > tr:hover > th {
    background-color: rgba(255, 255, 255, 0.075) !important;
}

/* Footer dark mode */
[data-bs-theme="dark"] footer.bg-light {
    background-color: #343a40 !important;
}

/* Pagination dark mode */
[data-bs-theme="dark"] .pagination .page-link {
    background-color: #212529 !important;
    border-color: #495057 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .pagination .page-link:hover {
    background-color: #343a40 !important;
    border-color: #495057 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .pagination .page-item.active .page-link {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
}

[data-bs-theme="dark"] .pagination .page-item.disabled .page-link {
    background-color: #212529 !important;
    border-color: #495057 !important;
    color: #6c757d !important;
}

/* List group dark mode */
[data-bs-theme="dark"] .list-group-item {
    background-color: #212529 !important;
    border-color: #495057 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .list-group-item:hover {
    background-color: #343a40 !important;
}

[data-bs-theme="dark"] .list-group-item.active {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
}

/* Progress bars dark mode */
[data-bs-theme="dark"] .progress {
    background-color: #343a40 !important;
}

/* Badge dark mode adjustments */
[data-bs-theme="dark"] .badge {
    color: #ffffff !important;
}

/* Navbar dark mode adjustments */
[data-bs-theme="dark"] .navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.85);
}

[data-bs-theme="dark"] .navbar-dark .navbar-nav .nav-link:hover {
    color: rgba(255, 255, 255, 1);
}

/* Footer dark mode */
[data-bs-theme="dark"] footer.bg-light {
    background-color: var(--bs-gray-800) !important;
}

/* Focus styles for dark mode */
[data-bs-theme="dark"] .btn:focus,
[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .nav-link:focus {
    outline: 2px solid #6ea8fe;
    outline-offset: 2px;
}

/* Custom utilities */
.text-break {
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Animation utilities */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Copy button styling */
.copy-btn {
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0.25rem;
    border-radius: 0.25rem;
}

.copy-btn:hover {
    background-color: var(--bs-gray-200);
    transform: scale(1.1);
}

.copy-btn:active {
    transform: scale(0.95);
}

.copy-btn i {
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.copy-btn:hover i {
    color: var(--bs-primary) !important;
}
