/* ================================================================
   SlideShow - Main Stylesheet
   Colors: Blue #093759, Orange #FF7F00, White #FFFFFF
   ================================================================ */

:root {
    --blue-darkest: #051e30;
    --blue-dark: #093759;
    --blue-mid: #0c4a78;
    --blue-light: #10609e;
    --orange: #FF7F00;
    --orange-hover: #e67200;
    --orange-subtle: rgba(255, 127, 0, 0.15);
    --white: #FFFFFF;
    --white-50: rgba(255, 255, 255, 0.5);
    --white-10: rgba(255, 255, 255, 0.1);
    --white-05: rgba(255, 255, 255, 0.05);
    --dark-input: rgba(255, 255, 255, 0.06);
    --dark-input-border: rgba(255, 255, 255, 0.12);
    --dark-input-focus: rgba(255, 127, 0, 0.3);
    --radius: 8px;
    --radius-sm: 6px;
    --radius-lg: 12px;
}

/* ----------------------------------------------------------------
   Base / Reset
   ---------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(160deg, var(--blue-darkest) 0%, var(--blue-dark) 40%, var(--blue-mid) 100%);
    color: var(--white);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: var(--orange);
    color: var(--white);
}

a { color: var(--orange); }
a:hover { color: var(--orange-hover); }

/* ----------------------------------------------------------------
   Utilities
   ---------------------------------------------------------------- */

.text-orange { color: var(--orange) !important; }
.bg-orange-subtle { background: var(--orange-subtle) !important; }
.bg-dark-tag {
    background: rgba(255, 255, 255, 0.08) !important;
    color: rgba(255, 255, 255, 0.7) !important;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.bg-dark-input { background: var(--dark-input) !important; }
.border-dark-input { border-color: var(--dark-input-border) !important; }

/* ----------------------------------------------------------------
   Flash Messages
   ---------------------------------------------------------------- */

.flash-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
}

.flash-container .alert {
    font-size: 0.875rem;
    backdrop-filter: blur(10px);
}

.flash-container .alert-danger {
    background: rgba(220, 53, 69, 0.95);
    color: var(--white);
}

.flash-container .alert-success {
    background: rgba(25, 135, 84, 0.95);
    color: var(--white);
}

.flash-container .alert-warning {
    background: rgba(255, 193, 7, 0.95);
    color: #000;
}

.flash-container .alert-info {
    background: rgba(13, 202, 240, 0.9);
    color: #000;
}

/* ----------------------------------------------------------------
   Button - Orange
   ---------------------------------------------------------------- */

.btn-orange {
    background: var(--orange);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.btn-orange:hover,
.btn-orange:focus {
    background: var(--orange-hover);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 127, 0, 0.35);
}

.btn-orange:active {
    transform: translateY(0);
}

/* ----------------------------------------------------------------
   Form Controls
   ---------------------------------------------------------------- */

.form-control:focus,
.form-select:focus {
    background: var(--dark-input) !important;
    border-color: var(--orange) !important;
    box-shadow: 0 0 0 3px var(--dark-input-focus) !important;
    color: var(--white) !important;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.form-check-input:checked {
    background-color: var(--orange);
    border-color: var(--orange);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px var(--dark-input-focus);
    border-color: var(--orange);
}

.input-group-text {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

/* ----------------------------------------------------------------
   Login Page
   ---------------------------------------------------------------- */

.login-page {
    background: linear-gradient(160deg, var(--blue-darkest) 0%, var(--blue-dark) 50%, var(--blue-mid) 100%);
    position: relative;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -20%;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 127, 0, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.login-page::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -10%;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(9, 55, 89, 0.5) 0%, transparent 70%);
    pointer-events: none;
}

.login-card {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 400px;
    position: relative;
    z-index: 1;
}

.logo-space {
    width: 60px;
    height: 60px;
    margin: 0 auto;
    border-radius: var(--radius);
    border: 2px dashed rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-space-sm {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1.5px dashed rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

/* ----------------------------------------------------------------
   Admin Layout / Navbar
   ---------------------------------------------------------------- */

.admin-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.navbar-admin {
    background: rgba(5, 30, 48, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    height: 56px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* ----------------------------------------------------------------
   Table
   ---------------------------------------------------------------- */

.table-custom {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: rgba(255, 255, 255, 0.03);
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.06);
}

.table-custom thead th {
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

.table-custom tbody td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

.table-custom tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.btn-group-last {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

/* ----------------------------------------------------------------
   Card Mobile
   ---------------------------------------------------------------- */

.card-mobile {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius);
    padding: 1rem;
}

/* ----------------------------------------------------------------
   Viewer Layout
   ---------------------------------------------------------------- */

.viewer-layout {
    background: var(--blue-darkest);
}

.viewer-topbar {
    background: rgba(5, 30, 48, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    height: 48px;
    flex-shrink: 0;
    z-index: 50;
}

.btn-viewer {
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    padding: 0.35rem 0.75rem;
    transition: all 0.2s ease;
}

.btn-viewer:hover {
    background: var(--orange);
    color: var(--white);
    border-color: var(--orange);
}

/* Sidebar */
.viewer-sidebar {
    width: 200px;
    background: rgba(5, 30, 48, 0.6);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-scroll {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.sidebar-scroll::-webkit-scrollbar {
    width: 4px;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}

.thumb-item {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 6px;
    margin-bottom: 4px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    border: 2px solid transparent;
}

.thumb-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.thumb-item.active {
    border-color: var(--orange);
    background: rgba(255, 127, 0, 0.08);
}

.thumb-number {
    font-size: 0.7rem;
    color: var(--orange);
    font-weight: 700;
    min-width: 18px;
    padding-top: 2px;
}

.thumb-img-wrap {
    flex: 1;
    border-radius: 4px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
}

.thumb-img-wrap img {
    width: 100%;
    display: block;
}

/* Main Slide */
.viewer-main {
    background: linear-gradient(180deg, rgba(5, 30, 48, 0.4) 0%, rgba(9, 55, 89, 0.3) 100%);
    position: relative;
    overflow: hidden;
}

.slide-container {
    overflow: hidden;
    padding: 12px;
}

.slide-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: none;
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.slide-img.active {
    display: block;
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

/* Navigation Arrows */
.slide-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.1rem;
    z-index: 10;
    opacity: 0;
}

.slide-container:hover .slide-nav,
.slideshow-overlay:hover .slideshow-nav {
    opacity: 1;
}

.slide-nav:hover {
    background: var(--orange);
    border-color: var(--orange);
    transform: translateY(-50%) scale(1.05);
}

.slide-nav-prev { left: 16px; }
.slide-nav-next { right: 16px; }

.slide-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
}

/* Mobile Thumbnails */
.mobile-thumbs {
    background: rgba(5, 30, 48, 0.8);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.mobile-thumbs::-webkit-scrollbar { display: none; }

.mobile-thumb {
    flex-shrink: 0;
    width: 60px;
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.mobile-thumb.active {
    border-color: var(--orange);
}

.mobile-thumb img {
    width: 100%;
    display: block;
}

.mobile-thumb-num {
    position: absolute;
    top: 2px;
    left: 2px;
    background: rgba(0, 0, 0, 0.6);
    color: var(--white);
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0 4px;
    border-radius: 2px;
    line-height: 1.4;
}

/* Viewer Footer */
.viewer-footer {
    background: rgba(5, 30, 48, 0.85);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.footer-info h6 { font-size: 0.875rem; }
.footer-info p { font-size: 0.75rem; }

/* ----------------------------------------------------------------
   Slideshow Overlay (Fullscreen)
   ---------------------------------------------------------------- */

.slideshow-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 10000;
    cursor: none;
}

.slideshow-overlay:hover { cursor: default; }

.slideshow-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10001;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    opacity: 0;
}

.slideshow-overlay:hover .slideshow-close { opacity: 1; }
.slideshow-close:hover { background: var(--orange); }

.slideshow-container {
    width: 100%;
    height: 100%;
    padding: 20px;
}

.slideshow-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: none;
}

.slideshow-img.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.slideshow-nav {
    opacity: 0;
}

.slideshow-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 20px;
    z-index: 10001;
}

/* ----------------------------------------------------------------
   Empty State
   ---------------------------------------------------------------- */

.empty-state i {
    opacity: 0.3;
}

/* ----------------------------------------------------------------
   Link display
   ---------------------------------------------------------------- */

.link-display {
    word-break: break-all;
}

/* ----------------------------------------------------------------
   Toast notification
   ---------------------------------------------------------------- */

.toast-copied {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--orange);
    color: var(--white);
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    z-index: 99999;
    box-shadow: 0 4px 16px rgba(255, 127, 0, 0.4);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 1.7s;
    pointer-events: none;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* ----------------------------------------------------------------
   Responsive tweaks
   ---------------------------------------------------------------- */

@media (max-width: 767.98px) {
    .viewer-sidebar { display: none !important; }

    .slide-nav {
        opacity: 0.7;
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .slide-nav-prev { left: 8px; }
    .slide-nav-next { right: 8px; }

    .slide-container { padding: 8px; }

    .login-card {
        margin: 1rem;
        padding: 2rem 1.5rem;
    }

    .viewer-footer { padding: 8px 12px !important; }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    .viewer-sidebar { width: 170px; }
}

@media (min-width: 1200px) {
    .viewer-sidebar { width: 220px; }
}

/* ----------------------------------------------------------------
   Scrollbar (global)
   ---------------------------------------------------------------- */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}
