/* =========================================
   GJVJ 8.E — Modern Redesign
   ========================================= */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { overflow-y: scroll; scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #1e293b;
    background: #eef2f7;
    margin: 0;
}

/* --- Header / Banner --- */
#MainBanner {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 50%, #1e40af 100%);
    box-shadow: 0 2px 20px rgba(30, 64, 175, 0.4);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

#MainBanner-inner {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 0 24px;
    height: 70px;
    gap: 20px;
}

#logo {
    display: block;
    width: 180px;
    height: 50px;
    background-image: url('../images/logoVelke3.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: left center;
    flex-shrink: 0;
    opacity: 0.92;
    filter: brightness(0) invert(1);
}

#GJVJlogo {
    display: block;
    width: 50px;
    height: 50px;
    background-image: url('../images/logo-white_s.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}

#MainBanner h1 {
    color: rgba(255,255,255,0.25);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    flex: 1;
}

/* 8.E logo replacing the old bstudio camera icon */
#EightElogo {
    color: white;
    text-decoration: none;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -1px;
    flex-shrink: 0;
    line-height: 1;
    padding: 4px 2px;
    border-bottom: 2px solid rgba(255,255,255,0.35);
    transition: border-color 0.2s, color 0.2s;
}

#EightElogo:hover {
    color: white;
    border-bottom-color: rgba(255,255,255,0.8);
    text-decoration: none;
}

#MainBanner span#login {
    float: none;
    margin: 0;
    flex-shrink: 0;
}

#MainBanner span#login a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 16px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    transition: all 0.2s;
}

#MainBanner span#login a:hover {
    background: rgba(255,255,255,0.15);
    color: white;
    border-color: rgba(255,255,255,0.6);
}

/* --- Page wrapper ---
   overflow-x: auto + flex centering keeps the grid centered on wide screens
   and allows horizontal scroll on narrow screens without breaking the layout */
#content {
    padding: 28px 16px 40px;
    overflow-x: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* --- Main grid --- */
.boxes {
    display: inline-flex;   /* shrinks to content width so centering works */
    align-items: flex-start;
    flex-shrink: 0;
}

/* =============================================
   ROW HEIGHT CONTRACT
   Both box1 person rows and box2 video rows
   must be exactly ROW_HEIGHT tall so columns align.
   Header rows must also match.
   ============================================= */

/* Shared constants (change these two values to resize everything) */
:root {
    --row-h: 120px;   /* height of each data row */
    --head-h: 80px;   /* height of year / calendar header row */
}

/* --- People column (box1) --- */
div.box1 {
    background: white;
    border-radius: 12px 0 0 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    flex-shrink: 0;
    width: 170px;
    overflow: hidden;
}

/* Calendar header — must match .boxes h2 height */
div.box1 > div:first-child {
    height: var(--head-h);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

div.calendarImage {
    padding: 8px;
}

div.calendarImage img {
    width: 44px;
    opacity: 0.45;
}

/* Person rows — must match div.box2 > div height */
div.peopleImage {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 10px;
    height: var(--row-h);
    border-bottom: 1px solid #f1f5f9;
    text-align: left;
    font-size: 12.5px;
    color: #334155;
    line-height: 1.3;
    transition: background 0.15s;
    overflow: hidden;
}

div.peopleImage:hover {
    background: #f0f7ff;
}

/* Circular photo */
div.peopleImage > div {
    flex-shrink: 0;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    overflow: hidden;
    background: #e2e8f0;
}

div.peopleImage > div img {
    width: 54px;
    height: 54px;
    object-fit: cover;
    display: block;
}

/* --- Year columns (box2) --- */
div.box2 {
    flex: 0 0 auto;
    text-align: center;
    background: white;
    border-left: 1px solid #e2e8f0;
    width: 200px;
}

div.box2:last-child {
    border-radius: 0 12px 12px 0;
    overflow: hidden;
}

/* Each video cell — must match div.peopleImage height */
div.box2 > div {
    height: var(--row-h);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-bottom: 1px solid #f1f5f9;
    padding: 8px 8px 6px;
    position: relative;
}

div.box2 > div:hover {
    background: #f8fafc;
}

/* Year headings — must match div.box1 > div:first-child height */
.boxes h2 {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: #1e40af;
    height: var(--head-h) !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin: 0;
    background: #f8fafc;
    border-bottom: 2px solid #dbeafe;
    letter-spacing: -0.5px;
}

/* Orange year accent (2008 column uses inline style color #DB8E34) */
div.box2 h2[style*="DB8E34"],
div.box2 h2[style*="db8e34"] {
    color: #ea7c1a !important;
    border-bottom-color: #fed7aa !important;
}

/* --- Video thumbnails ---
   16:9 ratio: at 180px wide → 101px tall.
   Row is 120px; with padding 8px top + 6px bottom = 14px,
   and ~14px for duration text + 4px gap → 120 - 14 - 18 = 88px thumb height.
   We use 180×101 and let the row clip via overflow on the cell. */
div.bgImage,
div.bgImageBlank,
div.bgImageCross {
    width: 180px;
    height: 101px;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    background: #1e293b;
    flex-shrink: 0;
}

div.bgImageBlank {
    background: #dde3ec;
}

div.bgImageCross {
    background: #f1f5f9;
}

div.bgImageCross::after {
    content: '✕';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b0bec5;
    font-size: 16px;
}

a.vidThumbnail {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

a.vidThumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.88;
    transition: opacity 0.2s, transform 0.25s;
    margin: 0;
    padding: 0;
    display: block;
}

a.vidThumbnail:hover img {
    opacity: 1;
    transform: scale(1.05);
}

/* Play button overlay */
a.vidThumbnail::after {
    content: '▶';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.9);
    font-size: 18px;
    text-shadow: 0 1px 6px rgba(0,0,0,0.6);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

a.vidThumbnail:hover::after {
    opacity: 1;
}

/* Duration label */
span.underTitle {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
    letter-spacing: 0.03em;
    line-height: 1;
    padding: 0;
    background: none;
}

/* --- Sign in form --- */
form#frm-signInForm {
    background: white;
    width: 340px;
    margin: 60px auto;
    padding: 36px 40px;
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(30,64,175,0.10);
    border: 1px solid #e2e8f0;
}

form#frm-signInForm .text {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    color: #1e293b;
    transition: border-color 0.2s;
    outline: none;
}

form#frm-signInForm .text:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

form#frm-signInForm .button {
    width: 100%;
    padding: 10px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 4px;
}

form#frm-signInForm .button:hover {
    background: #1d4ed8;
}

form th, form td {
    vertical-align: top;
    font-weight: normal;
    padding: 4px 0;
}

form .required label {
    font-weight: 600;
}

form .error {
    color: #dc2626;
    font-size: 12px;
}

/* --- Flash messages --- */
div.flash {
    color: #92400e;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    padding: 12px 16px;
    margin: 16px auto;
    border-radius: 8px;
    max-width: 1600px;
}

div.flash.success {
    color: #14532d;
    background: #dcfce7;
    border-color: #86efac;
}

/* --- Header nav: multiple links side-by-side --- */
#MainBanner span#login {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* --- Settings page --- */
.settings-wrap {
    display: flex;
    justify-content: center;
    padding: 40px 16px;
}

.settings-card {
    background: white;
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(30,64,175,0.10);
    border: 1px solid #e2e8f0;
    width: 460px;
    max-width: 100%;
    padding: 36px 40px;
}

.settings-card h2 {
    margin-bottom: 6px;
    font-size: 20px;
}

.settings-info {
    color: #64748b;
    font-size: 13px;
    margin-bottom: 24px;
}

.settings-section {
    margin-bottom: 28px;
    border-top: 1px solid #e2e8f0;
    padding-top: 20px;
}

.settings-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: #1e40af;
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.settings-hint {
    font-size: 12px;
    color: #94a3b8;
    margin: -8px 0 12px;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
}

.form-row label {
    font-size: 13px;
    font-weight: 500;
    color: #334155;
}

.form-row .text {
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    color: #1e293b;
    font-family: inherit;
    transition: border-color 0.2s;
    outline: none;
    width: 100%;
}

.form-row .text:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.form-row .text:disabled {
    background: #f8fafc;
    color: #94a3b8;
    cursor: not-allowed;
}

.form-row--checkbox {
    flex-direction: row;
    align-items: center;
    gap: 0;
}

.form-row--checkbox input[type=checkbox] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin-right: 8px;
    flex-shrink: 0;
}

.form-row--checkbox label {
    font-weight: 400;
    cursor: pointer;
}

/* --- Back button --- */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 22px;
    padding: 6px 14px 6px 10px;
    font-size: 13px;
    font-weight: 500;
    color: #2563eb;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.btn-back:hover {
    background: #dbeafe;
    border-color: #93c5fd;
    text-decoration: none;
}

.form-row--submit {
    margin-top: 8px;
}

.form-row--submit .button {
    width: 100%;
    padding: 10px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.form-row--submit .button:hover {
    background: #1d4ed8;
}

.form-error {
    color: #dc2626;
    font-size: 12px;
}

/* --- Links --- */
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { color: #1e40af; }

/* --- Lightbox open animation ---
   resizespeed:0 kills the old width/height slide; we replace it with
   a CSS scale+fade that triggers when the parent goes display:none → block */
@keyframes lightbox-overlay-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes lightbox-box-in {
    from { opacity: 0; transform: scale(0.88) translateY(24px); }
    to   { opacity: 1; transform: scale(1)    translateY(0); }
}

#html5box-html5-lightbox #html5-lightbox-overlay {
    animation: lightbox-overlay-in 0.35s ease-out both;
}
#html5box-html5-lightbox #html5-lightbox-box {
    animation: lightbox-box-in 0.45s cubic-bezier(0.34, 1.3, 0.64, 1) both;
}

/* --- Lightbox prev/next panels --- */
.gjvj-nav {
    position: absolute;
    top: 20%;           /* 20% clear space above */
    height: 60%;        /* occupies the middle 60%, leaving 20% below too */
    width: 14%;         /* narrow enough not to obscure subtitles/controls */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.20);
    border-radius: 6px;
    transition: background 0.15s;
}

.gjvj-nav:hover {
    background: rgba(0, 0, 0, 0.38);
}

.gjvj-nav span {
    color: white;
    font-size: 44px;
    line-height: 1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
    pointer-events: none;
    user-select: none;
}

#gjvj-nav-prev { left: 1%; }
#gjvj-nav-next { right: 1%; }

/* Keep the close button above our nav panels */
#html5-close,
#html5-close-fullscreen {
    z-index: 10000 !important;
}

/* --- Mobile --- */
@media (max-width: 768px) {
    /* On narrow screens, start grid from the left edge so it scrolls right.
       Centering would hide the leftmost column with no way to scroll back. */
    #content {
        justify-content: flex-start;
        padding: 12px 0 40px;
    }

    div.box1 {
        width: 130px;
    }

    div.peopleImage {
        font-size: 11px;
        gap: 6px;
        padding: 0 6px;
    }

    div.peopleImage > div {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
    }

    div.peopleImage > div img {
        width: 40px;
        height: 40px;
    }

    div.box2 {
        width: 160px;
    }

    div.bgImage,
    div.bgImageBlank,
    div.bgImageCross {
        width: 144px;
        height: 81px;
    }
}

/* --- Ajax spinner --- */
#ajax-spinner {
    margin: 15px 0 0 15px;
    padding: 13px;
    background: white url('../images/spinner.gif') no-repeat 50% 50%;
    font-size: 0;
    z-index: 123456;
    display: none;
}
