/* ============================================
   Timeline Showcase Styles
   Matches maxreptracker-timeline plugin's visual
   ============================================ */

/* ---------- Container ---------- */

.mrt-timeline-container {
    width: 100%;
    margin: 24px auto;
    padding: 20px;
    box-sizing: border-box;
    overflow: hidden;
    background: #ffffff;
    border-radius: 18px;
    border: none;
    box-shadow: none;
}

html.maxreptracker-dark-mode-enabled .mrt-timeline-container {
    background: #1a1a1a;
    border-color: rgba(255, 255, 255, 0.08);
}

/* ---------- Header ---------- */

.mrt-timeline-header-section {
    margin-bottom: 16px;
}

.mrt-timeline-title-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mrt-tl-header-icon {
    color: #0082fc;
    flex-shrink: 0;
}

.mrt-timeline-title-container h3 {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: normal;
}


/* ---------- Horizontal Scroll Area ---------- */

#mrt-timeline-images {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    padding-bottom: 24px;
    scrollbar-width: none;
}

@supports not (scrollbar-color: auto) {
    #mrt-timeline-images::-webkit-scrollbar {
        height: 0;
        display: none;
    }
}

/* Custom thin scrollbar on desktops */
@media (pointer: fine) {
    #mrt-timeline-images {
        scrollbar-width: thin;
        scrollbar-color: rgba(0, 130, 252, 0.4) transparent;
    }
    @supports not (scrollbar-color: auto) {
        #mrt-timeline-images::-webkit-scrollbar {
            height: 4px;
            display: block;
        }
        #mrt-timeline-images::-webkit-scrollbar-track {
            background: transparent;
            margin: 0 16px;
        }
        #mrt-timeline-images::-webkit-scrollbar-thumb {
            background: rgba(0, 130, 252, 0.2);
            border-radius: 10px;
            transition: background 0.3s ease;
        }
        #mrt-timeline-images:hover::-webkit-scrollbar-thumb {
            background: linear-gradient(90deg, #0082fc, #00ff3c);
        }
    }
}

/* ---------- Card Items ---------- */

.mrt-timeline-item {
    flex: 0 0 240px;
    scroll-snap-align: start;
    border-radius: 16px;
    overflow: hidden;
}

.mrt-timeline-image-container {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: none;
}

.mrt-timeline-placeholder {
    width: 100%;
    height: 340px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
}

.mrt-tl-camera-icon {
    width: 56px;
    height: 56px;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
}

/* ---------- Date Overlay ---------- */

.mrt-timeline-date {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    letter-spacing: 0.01em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    z-index: 3;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* ---------- Animation State ---------- */

#mrt-timeline-images.mrt-animating {
    scroll-behavior: auto;
    scroll-snap-type: none;
}

/* ---------- Dark Mode: dim placeholders ---------- */

html.maxreptracker-dark-mode-enabled .mrt-timeline-placeholder {
    filter: brightness(0.92) saturate(0.85);
}

/* ---------- Reduced Motion ---------- */

@media (prefers-reduced-motion: reduce) {
    #mrt-timeline-images {
        scroll-behavior: auto;
    }
}

/* ---------- Responsive: 768px ---------- */

@media (max-width: 768px) {
    .mrt-timeline-item {
        flex: 0 0 auto;
        width: calc(50% - 8px);
    }

    .mrt-timeline-placeholder {
        height: 280px;
    }
}

/* ---------- Responsive: 480px ---------- */

@media (max-width: 480px) {
    .mrt-timeline-container {
        padding: 14px;
        border-radius: 16px;
    }

    .mrt-timeline-item {
        flex: 0 0 180px;
    }

    .mrt-timeline-placeholder {
        height: 260px;
    }

    .mrt-tl-camera-icon {
        width: 44px;
        height: 44px;
    }

    .mrt-timeline-date {
        font-size: 0.8rem;
        padding: 10px 12px;
    }
}

/* ---------- Responsive: 360px ---------- */

@media (max-width: 360px) {
    .mrt-timeline-item {
        flex: 0 0 150px;
    }

    .mrt-timeline-placeholder {
        height: 220px;
    }

    .mrt-tl-camera-icon {
        width: 36px;
        height: 36px;
    }
}

/* ============================================
   Image Modal (matches timeline plugin)
   ============================================ */

.mrt-image-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.mrt-image-modal.active {
    display: flex;
}

.mrt-modal-overlay {
    position: absolute;
    inset: 0;
    background: transparent;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.mrt-modal-content {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    padding: 24px;
    max-width: 520px;
    width: 90vw;
    box-shadow: none;
    animation: mrt-modal-enter 0.25s ease-out;
}

@keyframes mrt-modal-enter {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

html.maxreptracker-dark-mode-enabled .mrt-modal-content {
    background: linear-gradient(
        145deg,
        rgba(32, 32, 35, 0.98) 0%,
        rgba(24, 24, 28, 0.99) 100%
    );
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

.mrt-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 50%;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    color: #1f2937;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s;
}

.mrt-modal-close:hover {
    background: rgba(0, 0, 0, 0.15);
}

html.maxreptracker-dark-mode-enabled .mrt-modal-close {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

html.maxreptracker-dark-mode-enabled .mrt-modal-close:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.15);
}

.mrt-modal-prev,
.mrt-modal-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 50%;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s;
}

.mrt-modal-prev {
    left: 12px;
}

.mrt-modal-next {
    right: 12px;
}

.mrt-modal-prev:hover,
.mrt-modal-next:hover {
    background: rgba(0, 0, 0, 0.65);
}

html.maxreptracker-dark-mode-enabled .mrt-modal-prev,
html.maxreptracker-dark-mode-enabled .mrt-modal-next {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

html.maxreptracker-dark-mode-enabled .mrt-modal-prev:hover,
html.maxreptracker-dark-mode-enabled .mrt-modal-next:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.12);
}

html.maxreptracker-dark-mode-enabled .mrt-modal-prev:focus,
html.maxreptracker-dark-mode-enabled .mrt-modal-next:focus,
html.maxreptracker-dark-mode-enabled .mrt-modal-prev:active,
html.maxreptracker-dark-mode-enabled .mrt-modal-next:active {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
}

.mrt-modal-image-container {
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 16px;
}

.mrt-modal-placeholder {
    width: 100%;
    height: 340px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
}

.mrt-modal-placeholder .mrt-tl-camera-icon {
    width: 72px;
    height: 72px;
}

.mrt-modal-info {
    text-align: center;
    margin-bottom: 8px;
}

.mrt-modal-date {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1f2937;
}

html.maxreptracker-dark-mode-enabled .mrt-modal-date {
    color: rgba(255, 255, 255, 0.55);
}

html.maxreptracker-dark-mode-enabled .mrt-modal-counter {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

html.maxreptracker-dark-mode-enabled .mrt-modal-info {
    background: linear-gradient(
        180deg,
        rgba(28, 28, 32, 0.98) 0%,
        rgba(24, 24, 28, 1) 100%
    );
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

html.maxreptracker-dark-mode-enabled .mrt-modal-info {
    background: transparent;
    border: none;
}

html.maxreptracker-dark-mode-enabled .mrt-modal-counter {
    background: transparent;
    border: none;
}

.mrt-modal-counter {
    text-align: center;
    font-size: 0.85rem;
    color: #94a3b8;
    font-weight: 500;
}

html.maxreptracker-dark-mode-enabled .mrt-modal-counter {
    color: #64748b;
}

/* Modal responsive */
@media (max-width: 480px) {
    .mrt-modal-content {
        padding: 16px;
        width: 95vw;
        border-radius: 16px;
    }

    .mrt-modal-placeholder {
        height: 260px;
    }

    .mrt-modal-placeholder .mrt-tl-camera-icon {
        width: 56px;
        height: 56px;
    }

    .mrt-modal-prev,
    .mrt-modal-next {
        width: 38px;
        height: 38px;
        font-size: 1.4rem;
    }
}

@media (max-width: 360px) {
    .mrt-modal-content {
        padding: 12px;
        width: 98vw;
        border-radius: 12px;
    }

    .mrt-modal-placeholder {
        height: 200px;
    }

    .mrt-modal-placeholder .mrt-tl-camera-icon {
        width: 44px;
        height: 44px;
    }

    .mrt-modal-close {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mrt-modal-content {
        animation: none;
    }
}
