/* ============================================================
   VIEW BUS PAGE STYLES
   Extracted from inline styles in user/view-bus.php
   ============================================================ */

/* ----------------------------------------------------------
   PHOTO GALLERY
   ---------------------------------------------------------- */

/* No photos message styling */
.no-photos-message {
    background: var(--card-bg, #f8f9fa);
    border-radius: 12px;
    border: 2px dashed var(--border-color, #dee2e6);
}

.no-photos-message i.fa-camera {
    opacity: 0.4;
}

.theme-dark .no-photos-message,
[data-bs-theme="dark"] .no-photos-message {
    background: #2D3748;
    border-color: #4a5568;
}

/* Photo gallery container */
.photo-gallery-container .photo-thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.photo-gallery-container .photo-thumbnail:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.photo-gallery-page {
    display: none;
}

.photo-gallery-page.active {
    display: block;
}

@media (min-width: 768px) {
    .photo-gallery-container .photo-thumbnail {
        height: 250px;
    }
}

/* ----------------------------------------------------------
   PHOTO MODAL / LIGHTBOX
   ---------------------------------------------------------- */

.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox-overlay.show {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.lightbox-close:hover {
    opacity: 1;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 2rem;
    padding: 1rem;
    cursor: pointer;
    border-radius: 8px;
    opacity: 0.7;
    transition: opacity 0.2s, background 0.2s;
}

.lightbox-nav:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev {
    left: -60px;
}

.lightbox-next {
    right: -60px;
}

.lightbox-counter {
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 0.9rem;
    opacity: 0.7;
}

/* ----------------------------------------------------------
   CUSTOM TOOLTIP
   ---------------------------------------------------------- */

.custom-tooltip {
    position: relative;
    cursor: help;
    display: inline-block;
}

.custom-tooltip::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #212529;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.813rem;
    font-weight: 400;
    font-style: normal;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s, visibility 0.15s;
    z-index: 99999;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.custom-tooltip::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #212529;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s, visibility 0.15s;
    z-index: 99999;
}

.custom-tooltip:hover::after,
.custom-tooltip:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Dark theme tooltip adjustments */
.theme-dark .custom-tooltip::after,
[data-bs-theme="dark"] .custom-tooltip::after {
    background: #f8f9fa;
    color: #212529;
}

.theme-dark .custom-tooltip::before,
[data-bs-theme="dark"] .custom-tooltip::before {
    border-top-color: #f8f9fa;
}

/* ----------------------------------------------------------
   ACTION BUTTONS
   ---------------------------------------------------------- */

.bus-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

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

/* ----------------------------------------------------------
   BUS STATUS BADGES
   ---------------------------------------------------------- */

.bus-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.813rem;
    font-weight: 600;
}

/* ----------------------------------------------------------
   EDIT HISTORY PANEL
   ---------------------------------------------------------- */

.edit-history-panel {
    max-height: 400px;
    overflow-y: auto;
}

.edit-history-item {
    padding: 0.75rem;
    border-left: 3px solid var(--bs-primary);
    background: var(--card-bg, #f8f9fa);
    margin-bottom: 0.5rem;
    border-radius: 0 6px 6px 0;
}

.theme-dark .edit-history-item,
[data-bs-theme="dark"] .edit-history-item {
    background: #2D3748;
}

/* ----------------------------------------------------------
   RESPONSIVE ADJUSTMENTS
   ---------------------------------------------------------- */

@media (max-width: 767.98px) {
    .lightbox-nav {
        display: none;
    }
    
    .lightbox-content {
        max-width: 95vw;
    }
}

/* ----------------------------------------------------------
   TIMELINE LINK CARD
   ---------------------------------------------------------- */

.timeline-link-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}
.timeline-link-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border-color: var(--color-primary, #0d6efd) !important;
}
[data-bs-theme="dark"] .timeline-link-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
.timeline-link-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--color-primary, #0d6efd), #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* ----------------------------------------------------------
   PHOTO NAVIGATION BUTTONS
   ---------------------------------------------------------- */

.btn-photo-nav {
    opacity: 0.7;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
    z-index: 10;
}
.btn-photo-nav:hover {
    opacity: 1;
}

.photo-thumbnail {
    transition: opacity 0.2s ease;
}
.photo-thumbnail:hover {
    opacity: 0.85;
}

.modal-footer a:hover {
    text-decoration: underline !important;
}

/* ----------------------------------------------------------
   PHOTO CREDITS
   ---------------------------------------------------------- */

.photo-credit {
    line-height: 1.3;
}
.photo-caption-text {
    font-size: 1rem;
    color: var(--bs-body-color, #212529);
}
.photo-provided-by {
    font-size: 0.85rem;
    opacity: 0.6;
}
.photo-provided-by a {
    color: var(--text-muted, #6c757d);
}
.photo-provided-by a:hover {
    opacity: 1;
}

/* ----------------------------------------------------------
   FAVOURITE BUTTON
   ---------------------------------------------------------- */

.favourite-toggle {
    transition: all 0.3s ease;
    font-weight: 500;
    border-width: 2px;
    background-color: #ffc107;
    border-color: #ffc107;
    color: #000;
}
.favourite-toggle:hover {
    background-color: #ffb300;
    border-color: #ffb300;
    color: #000;
    transform: scale(1.05);
}
.favourite-toggle.is-favourited {
    box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.3);
}
.favourite-toggle i {
    transition: transform 0.2s ease;
}
.favourite-toggle:hover i {
    transform: rotate(72deg);
}

/* ----------------------------------------------------------
   BOOTSTRAP TOOLTIP FIX
   ---------------------------------------------------------- */

.tooltip {
    z-index: 99999 !important;
}
.tooltip.show {
    opacity: 1 !important;
}

/* ----------------------------------------------------------
   RESPONSIVE
   ---------------------------------------------------------- */

@media (max-width: 576px) {
    .btn {
        padding: 0.5rem 0.75rem;
    }
    .btn i {
        font-size: 1rem;
    }
}

/* ----------------------------------------------------------
   EDIT HISTORY CARD
   Matches the Timeline link card visual style
   ---------------------------------------------------------- */

.edit-history-card {
    transition: border-color var(--transition-fast);
}

.edit-history-toggle:hover {
    opacity: 0.9;
}

.edit-history-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, #64748b, #475569);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Individual entries — clean card-style list */
.edit-history-list {
    border-top: 1px solid var(--border-color);
    max-height: 400px;
    overflow-y: auto;
}

.edit-history-entry {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}

.edit-history-entry:last-child {
    border-bottom: none;
}

.edit-history-entry:hover {
    background: var(--bg-card-hover, var(--bg-surface));
}

.edit-history-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.2rem;
}

.edit-history-editor {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.edit-history-date {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.edit-history-change {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.edit-history-field {
    background: var(--bg-surface, #f1f5f9);
    padding: 0.1rem 0.45rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.edit-history-old {
    text-decoration: line-through;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.edit-history-arrow {
    font-size: 0.6rem;
    color: var(--text-muted);
}

.edit-history-new {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.78rem;
}

/* Scrollbar styling for edit history */
.edit-history-list::-webkit-scrollbar {
    width: 5px;
}

.edit-history-list::-webkit-scrollbar-track {
    background: transparent;
}

.edit-history-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

/* ----------------------------------------------------------
   SECTION HELP NUDGE
   Gentle prompt next to section headings for missing data
   ---------------------------------------------------------- */

.section-help-nudge {
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: var(--color-primary);
    text-decoration: none;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    background: var(--bg-surface, #f1f5f9);
    margin-left: 0.5rem;
    vertical-align: middle;
    transition: all var(--transition-fast);
}

.section-help-nudge:hover {
    background: var(--color-primary);
    color: #fff;
}
