﻿/* ROOT VARIABLES */
:root {
    --bg: #f5f5f5;
    --primary: #005bbb;
    --primary-dark: #00408a;
    --accent: #ffb300;
    --danger: #c62828;
    --text: #111;
    --text-light: #fff;
    --card-bg: #ffffff;
    --border: #d0d0d0;
    --shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
    --font-lg: 2.0rem;
    --font-xl: 2.2rem;
    --font-xxl: 2.8rem;
    --button-height: 3.5rem;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
}

button {
    font-family: inherit;
    cursor: pointer;
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}


/* =========================
   NAV (taken from style.css)
   ========================= */
nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
    background: #003f66;
    padding: 0.5rem;
}

    nav a {
        color: #f9f9f0; /*original white*/
        text-decoration: none;
        font-size: 1.2rem;
        font-weight: bold;
    }

        nav a.active {
            color: #FFFF00; /* yellow; */
            text-decoration: underline;
            background-color: #005f99;
            padding: 0.3rem 0.6rem;
            border-radius: 5px;
        }


header {
    text-align: center;
    padding: 1rem;
    background-color: #005f99;
    color: white;
}

/* HEADER 
header {
    padding: 1.2rem 1.5rem;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
*/
.header-title {
    font-size: var(--font-xxl);
    font-weight: 700;
}

/* MAIN */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.5rem;
}

/* HOME PAGE */
.home-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.home-title {
    font-size: var(--font-xl);
    font-weight: 700;
}

.album-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    width: 100%;
    max-width: 900px;
}

.album-card {
    flex: 1 1 260px;
    max-width: 360px;
    min-height: 180px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 5px solid transparent;
    transition: 0.15s;
}

    .album-card.selected {
        border-color: var(--primary);
        box-shadow: 0 0 0 4px rgba(0, 91, 187, 0.15);
    }

    .album-card:hover {
        transform: translateY(-2px);
    }

.album-card-title {
    font-size: var(--font-lg);
    font-weight: 700;
}

.album-card-subtitle {
    font-size: 1.5rem;
    color: #555;
}

.album-card-footer {
    font-size: 1rem;
    color: #777;
}

/* BUTTONS */
.btn {
    border: none;
    border-radius: var(--radius-md);
    padding: 0 1.5rem;
    height: var(--button-height);
    font-size: 1.2rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    background: var(--primary);
    color: var(--text-light);
    cursor: pointer;
}

    .btn:hover {
        background: var(--primary-dark);
    }
    .btn:active {
        transform: scale(0.96);
        filter: brightness(0.85);
        background-color: #ffd400; /* yellow */
        color: #000;
        box-shadow: 0 0 0 4px rgba(255, 212, 0, 0.5);
    }

    .btn.secondary {
        background: #ffffff;
        color: var(--primary);
        border: 2px solid var(--primary);
    }

    .btn.accent {
        background: var(--accent);
        color: #000;
    }

    .btn.danger {
        background: var(--danger);
        color: #fff;
    }

/* BROWSE BY DATE */
.browse-by-date-panel {
    display: none;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1rem;
    max-width: 900px;
    width: 100%;
}

    .browse-by-date-panel.visible {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

.year-tab {
    display: flex;
    justify-content: center;
    gap: 1rem;
    font-size: 1.4rem;
    font-weight: 700;
}

.year-arrow {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    font-size: 1.6rem;
}

.month-carousel {
    display: flex;
    overflow-x: auto;
    gap: 0.75rem;
}

.month-item {
    min-width: 80px;
    padding: 0.6rem;
    background: #eee;
    border-radius: var(--radius-md);
    text-align: center;
    font-weight: 600;
    cursor: pointer;
}

    .month-item.selected {
        background: var(--primary);
        color: #fff;
    }

    /* ---- HOME PAGE ----*/
    #home-page {
    display: none;
}

    #home-page.active {
        display: block;
    }


/* BOTTOM */
.home-bottom {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #ddd;
    padding-top: 1rem;
}

/* BROWSE PAGE */
#browse-page {
    display: none;
}

    #browse-page.active {
        display: flex;
        flex-direction: column;
    }

.browse-header {
    font-size: var(--font-xl);
    font-weight: 700;
    text-align: center;
}

.picture-window {
    position: relative;
    width: 100%;
    height: 70vh; /* or any fixed height */
    /* background: black; */
    background: linear-gradient(135deg, #111, #222);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow); /* <--- added 02.04 */
    overflow: hidden; /* <--- added 02.04 */
}

.picture-window-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
}

#picture-window-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

    #picture-window-content img,
    #picture-window-content video {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
        display: block;
    }

.picture-window-empty {
    color: #ccc;
    font-size: 1.4rem;
    text-align: center;
    padding: 1rem;
}

.pw-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    font-size: 2rem;
}

.btn.active {
    background-color: #ffd400; /* yellow */
    color: #000;
    border-color: #ffd400;
}

/* the following was added on 02.04 */
.pw-arrow {
    backdrop-filter: blur(4px);
    transition: transform 0.15s, background 0.15s;
}

    .pw-arrow:hover {
        background: rgba(0,0,0,0.8);
        transform: translateY(-50%) scale(1.08);
    }
/*---------up to here ----------*/

    .pw-arrow,
    .thumb-arrow {
        pointer-events: auto;
        z-index: 20;
    }

    .pw-arrow.left {
        left: 0.5rem;
    }

    .pw-arrow.right {
        right: 0.5rem;
    }

.browse-bottom-left {
    font-size: 1.1rem;
    color: #555;
}

.pw-slideshow-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
}

.pw-slideshow-btn,
.pw-fullscreen-btn,
.pw-arrow {
    z-index: 10;
}

.btn.slideshow-active {
    background-color: #ffd400; /* yellow */
    color: #000;
    border-color: #ffd400;
}

.btn.fullscreen-active {
    background-color: #ffd400; /* yellow */
    color: #000;
    border-color: #ffd400;
}

.pw-fullscreen-btn {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
}

.thumbnail-strip {
    display: flex;
    gap: 1.0rem;
    overflow-x: auto;
    /* overflow-y: hidden; */
    /* prevent thumbnails from shrinking */
    align-items: center;
    /*  width: 100%;  */
    scroll-behavior: smooth;
    /* 🔥 KEY PART */
    max-width: 720px; /* 4 × 160px + gaps */
    margin: 0 auto; /* center it under the photo */
}

/* IMPORTANT: prevent flex shrink */
.thumbnail {
    width: 200px;
    height: 150px;
    flex: 0 0 auto; /* 🔥 this fixes shrinking */
    object-fit: contain;
    background: #111;
    border-radius: 10px;
    border: 4px solid transparent;
    cursor: pointer;
    /*   transition: transform 0.12s, border-color 0.12s; */
}

/* ----- video thumbnails --- */
    .thumbnail.video {
        position: relative;
    }

        .thumbnail.video::after {
            content: "▶";
            position: absolute;
            font-size: 2.2rem;
            color: white;
            background: rgba(0,0,0,0.6);
            border-radius: 50%;
            padding: 6px 10px;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            pointer-events: none;
        }

    .thumbnail:hover {
        transform: scale(1.05);
    }

    .thumbnail.active {
        outline: 4px solid #007bff; /* strong blue */
        outline-offset: -4px;
        box-shadow: 0 0 10px rgba(30, 144, 255, 0.8);
    }

    .thumbnail.selected {
        outline: 4px solid #007bff;
        outline-offset: -4px;
        box-shadow: 0 0 0 10px rgba(30, 144, 255, 0.8);
    }
.thumb-wrapper {
    position: relative;
    display: inline-block;
}

.video-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.65);
    color: white;
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 6px;
    pointer-events: none;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.thumbnail-strip-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.thumb-arrow {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.6);
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
}

    .thumb-arrow:hover {
        background: rgba(0,0,0,0.8);
    }

/* DIALOG */
.dialog-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: none;
    align-items: center;
    justify-content: center;
}

    .dialog-backdrop.visible {
        display: flex;
    }

.dialog {
    background: #fff;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    max-width: 420px;
    width: 90%;
    box-shadow: var(--shadow);
}

.dialog-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* MANAGE ALBUMS */

#manage-page {
    display: none;
}

    #manage-page.active {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

.manage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

.manage-cell {
    position: relative;
}

    .manage-cell img {
        width: 100%;
        border-radius: var(--radius-sm);
    }

.favorite-star {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 1.8rem;
    background: none;
    border: none;
    color: white;
    }

    .favorite-star.active {
        color: red;
        -webkit-text-stroke: 1px red;
        text-shadow: 0 0 4px rgba(0,0,0,0.6);
    }

/* ==========================
   FULLSCREEN MODE (Photo only)
========================== */

/* Hide everything except the photo window */
body.fullscreen-mode nav,
body.fullscreen-mode header,
body.fullscreen-mode .thumbnail-strip-container,
body.fullscreen-mode .browse-bottom,
body.fullscreen-mode .browse-header {
    display: none !important;
}

/* Make photo window fill the screen */
body.fullscreen-mode .picture-window-container {
    height: 100vh;
    margin: 0;
    padding: 0;
}

body.fullscreen-mode .picture-window {
    height: 100vh;
    width: 100vw;
    border-radius: 0;
}

/* Ensure image/video scales correctly 
body.fullscreen-mode .main-photo {
    max-width: 100vw;
    max-height: 100vh;
    object-fit: contain;
}
*/
body.fullscreen-mode #picture-window-content img,
body.fullscreen-mode #picture-window-content video {
    max-width: 100vw;
    max-height: 100vh;
    object-fit: contain;
}

/* ---- added 02.06 ---------*/
.month-item.disabled {
    opacity: 0.35;
    pointer-events: none;
    filter: grayscale(100%);
}