/* =======================================
   JohnnyLM Website Styles
   Main layout, header, navigation, cards, videos, blog, and responsive
   Author: JohnnyLM
   Updated: Full working version with dark/light theme, light video, blog cards
======================================= */

/* =======================
   Root Variables (Dark Theme)
======================= */
:root {
    --accent-color: #1E90FF; /* Primary blue */
    --bg-color: #111; /* Body background color */
    --text-color: #ccc; /* Default text color */
    --heading-color: #eee; /* Headings */
    --card-bg: #1a1a1a; /* Card backgrounds */
    --form-bg: #222; /* Form inputs background */
    --footer-bg: #222; /* Footer background */
    --background-image: url('../images/JLM_Albums.png'); /* Dark theme background */
}

/* =======================
   Light theme overrides
======================= */
html[data-theme="light"] {
    --bg-color: #f4f6f8;
    --text-color: #222;
    --heading-color: #111;
    --card-bg: #fdfdfd;
    --form-bg: #f5f5f5;
    --footer-bg: #eaeaea;
}

/* =======================
   Global link styles
======================= */
a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease, background-color 0.3s ease;
}

    a:hover {
        color: #ffffff;
        background-color: rgba(30, 144, 255, 0.1);
        border-radius: 4px;
    }

/* =======================
   Box sizing reset
======================= */
*, *::before, *::after {
    box-sizing: border-box;
}

/* =======================
   Base Layout
======================= */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background 0.3s ease, color 0.3s ease;
}

/* Dark theme background image */
html[data-theme="dark"] body {
    background-image: var(--background-image);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed; /* keeps image fixed */
}

/* Light theme: no background image */
html[data-theme="light"] body {
    background-image: none !important;
}

/* Main spacing for header/footer */
main {
    margin-top: 110px;
    margin-bottom: 60px;
    padding: 0 20px;
}

/* =======================
   Header
======================= */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 110px;
    background: url('../images/JLM_Banner.jpg') center / cover no-repeat;
    z-index: 1000;
    display: flex;
    align-items: center;
}

    header::before {
        content: "";
        position: absolute;
        inset: 0;
        background: inherit;
        filter: brightness(0.6);
        z-index: -1;
    }

.header-container {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 30px;
}

/* Logo */
.logo-container a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-container img {
    height: 50px;
    margin-right: 10px;
}

.site-name {
    color: var(--accent-color);
    font-size: 1.5em;
    font-weight: bold;
    transition: color 0.3s ease;
}

.logo-container a:hover .site-name {
    color: #ffffff;
}

/* =======================
   Navigation Menu
======================= */
.nav-menu ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

    .nav-menu ul li {
        margin-left: 30px;
    }

        .nav-menu ul li a {
            color: var(--accent-color);
            text-decoration: none;
            font-weight: bold;
            transition: color 0.3s ease;
        }

            .nav-menu ul li a:hover {
                color: #ffffff;
                background-color: rgba(30, 144, 255, 0.1);
                border-radius: 4px;
            }

/* Hamburger Menu for Mobile */
.hamburger-menu {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 1100;
}

    .hamburger-menu .bar {
        width: 30px;
        height: 4px;
        background-color: var(--accent-color);
        border-radius: 10px;
    }

/* Mobile Navigation */
@media (max-width: 768px) {
    .logo-container {
        order: 1;
    }

    .hamburger-menu {
        display: flex;
        order: 2;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 110px;
        right: 0;
        width: 200px;
        background-color: rgba(34,34,34,0.95);
        padding: 20px;
        flex-direction: column;
        z-index: 1050;
    }

        .nav-menu.open {
            display: flex;
        }

            .nav-menu.open ul {
                flex-direction: column;
            }

                .nav-menu.open ul li {
                    margin-bottom: 20px;
                    margin-left: 0;
                }
}

/* =======================
   Page title
======================= */
.page-title {
    font-size: 2rem;
    font-weight: bold;
    line-height: 1.2;
    color: #eee;
    margin: 0 0 0px 0;
    padding-top: 20px;
    text-align: left;
}

/* =======================
   Cards (Projects / Contact / Bio)
======================= */
.contact-card-container,
.project-card-container,
.bio-card-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding-bottom: 30px;
}

.contact-card,
.project-card,
.bio-card {
    width: 100%;
    max-width: 800px;
    background-color: var(--card-bg);
    padding: 25px 20px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

    .contact-card h2,
    .project-card h2,
    .bio-card h2 {
        color: var(--accent-color);
    }

/* =======================
   Contact Form
======================= */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
}

    .contact-form label {
        color: var(--heading-color);
    }

    .contact-form input,
    .contact-form textarea {
        background-color: var(--form-bg);
        border: 1px solid #444;
        border-radius: 5px;
        padding: 10px;
        color: var(--text-color);
    }

    .contact-form textarea {
        min-height: 120px;
    }

    .contact-form button {
        background-color: var(--accent-color);
        border: none;
        padding: 10px;
        border-radius: 5px;
        color: #fff;
        cursor: pointer;
    }

        .contact-form button:hover {
            opacity: 0.9;
        }

/* =======================
   Footer
======================= */
footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    background-color: var(--footer-bg);
    color: var(--text-color);
    font-size: 0.9em;
    z-index: 1000;
}

.footer-inner {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 5px 20px;
}


/* =======================
   Language dropdown
======================= */
footer select[name="lang"] {
    position: fixed;
    left: 110px;
    bottom: 12px; /* Align vertical middle with toggle */
    background-color: var(--footer-bg); /* Same as footer */
    color: var(--text-color);
    border: 1px solid #444;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.85em;
    cursor: pointer;
    z-index: 1200;
    height: 34px; /* Match toggle height */

    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

    /* Make the dropdown options have the same color as the footer */
    footer select[name="lang"] option {
        background-color: var(--footer-bg); /* Same as footer */
        color: var(--text-color);
    }

    /* Hover effect */
    footer select[name="lang"]:hover {
        background-color: rgba(255,255,255,0.08); /* Match toggle hover */
    }

/* Mobile adjustments */
@media (max-width: 480px) {
    footer select[name="lang"] {
        font-size: 0.75em;
        padding: 3px 10px;
        left: 100px; /* Adjust spacing on small screens */
        height: 32px; /* Slightly smaller for mobile */
        bottom: 10px; /* Adjust vertical alignment for mobile */
    }
}



/* =======================
   Theme toggle button
======================= */
#theme-toggle {
    position: fixed;
    bottom: 16px;
    left: 8px;
    background-color: var(--footer-bg);
    border: 1px solid #444;
    color: var(--text-color);
    padding: 4px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85em;
    z-index: 1200;
}

    #theme-toggle:hover {
        background-color: rgba(255,255,255,0.08);
    }

@media (max-width: 480px) {
    #theme-toggle {
        font-size: 0.75em;
        padding: 3px 10px;
    }
}

/* =======================
   Light theme background video
   Full page video for all pages except blog
======================= */
.bg-video {
    position: fixed;
    top: 110px; /* below header */
    left: 0;
    width: 100%;
    height: calc(100vh - 110px - 60px); /* between header/footer */
    object-fit: contain;
    z-index: -1;
    opacity: 1; /* brighter */
    pointer-events: none;
    display: none;
    background-color: black; /* fallback */
}

html[data-theme="light"] .bg-video {
    display: block;
}

/* =======================
   Blog page video inside card
======================= */
.blog-video-card {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto 30px auto;
}

    .blog-video-card video {
        width: 100%;
        height: auto;
        border-radius: 12px;
        object-fit: cover;
    }

/* =======================
   Video grids (Projects)
======================= */
.video-grid, .project-video-grid, .full-width-video-grid {
    display: grid;
    gap: 15px;
}

.video-grid, .project-video-grid, .full-width-video-grid {
    grid-template-columns: repeat(6, 1fr);
}

.video-item, .project-video-item, .blog-video-item {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 8px;
}

    .video-item iframe, .video-item video,
    .project-video-item iframe, .project-video-item video,
    .blog-video-item iframe {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

/* Responsive video grids */
@media (max-width: 1200px) {
    .video-grid, .project-video-grid, .full-width-video-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .video-grid, .project-video-grid, .full-width-video-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .video-grid, .project-video-grid, .full-width-video-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* =======================
   Blog PDF & Video Styling
======================= */
.blog-video-container {
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
}

.blog-video-item {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

    .blog-video-item iframe {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }

.blog-pdf-container {
    width: 100%;
    max-width: 800px;
    margin: 2rem auto;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    background-color: var(--card-bg);
}

    .blog-pdf-container canvas {
        display: block;
        width: 100% !important;
        height: auto !important;
        margin-bottom: 10px;
        border-radius: 5px;
    }

/* =======================
   Pagination (centered)
======================= */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

    .pagination a {
        color: var(--accent-color);
        text-decoration: none;
        padding: 5px 10px;
        border-radius: 4px;
        transition: background-color 0.3s, color 0.3s;
    }

        .pagination a:hover {
            background-color: rgba(30, 144, 255, 0.1);
            color: #ffffff;
        }

        .pagination a.active-page {
            background-color: var(--accent-color);
            color: #fff;
        }

/* =======================
   Contact messages container
======================= */
.contact-message-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding-top: 30px;
}

    .contact-message-container .message-card {
        width: 100%;
        max-width: 800px;
        background-color: var(--card-bg);
        padding: 20px;
        border-radius: 12px;
        box-shadow: 0 6px 20px rgba(0,0,0,0.4);
        display: flex;
        flex-direction: column;
        gap: 10px;
        color: var(--text-color);
    }

.message-card .message-name {
    font-weight: bold;
    color: var(--accent-color);
    text-align: left;
}

.message-card .message-text {
    display: block;
    white-space: pre-wrap;
    text-align: left;
    word-break: break-word;
    margin: 0;
    padding: 0;
}

.message-card .message-date {
    font-size: 0.8em;
    color: #aaa;
    text-align: right;
}

.message-card .read-more {
    color: var(--accent-color);
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    background: none;
}

    .message-card .read-more:hover {
        color: #fff;
        text-decoration: none;
        background: none;
    }




/* =======================
   Dashboard Pagination – Clean, consistent, mobile-first
======================= */

/* Base styles – mobile first */
.pagination {
    display: flex; /* flex container for pagination items */
    flex-wrap: wrap; /* allow buttons to wrap to new line */
    gap: 5px; /* spacing between buttons */
    justify-content: center; /* center align buttons */
    margin-top: 10px;
    padding: 5px 0;
}

    .pagination a {
        flex: 0 0 auto; /* do not stretch buttons */
        min-width: 50px; /* tappable size */
        padding: 6px 12px;
        text-align: center;
        border-radius: 4px;
        text-decoration: none;
        background: transparent; /* match page background */
        color: #fff; /* white text for numbers */
        border: 1px solid rgba(255,255,255,0.3); /* subtle border */
        transition: background 0.2s, color 0.2s, border-color 0.2s;
    }

        .pagination a:hover {
            background: rgba(255,255,255,0.1); /* slight hover feedback */
        }

        /* Active page button */
        .pagination a.active-page {
            background: #4da3ff; /* active button blue */
            color: #fff;
            border-color: #4da3ff;
        }

        /* Optional: make first/last (Prev/Next) consistent */
        .pagination a:first-child,
        .pagination a:last-child {
            flex: 0 0 auto;
        }

/* Medium+ screens – slightly bigger buttons */
@media (min-width: 481px) {
    .pagination a {
        min-width: 60px;
        padding: 6px 14px;
        font-size: 1em;
    }
}



/* Grid for video & Spotify playlists */
.video-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr); /* exactly 6 items per row */
    gap: 20px; /* same spacing for columns and rows */
    margin-top: 20px;
}

/* Each video/playlist item */
.video-item {
    display: flex;
    justify-content: center;
}

    /* iframe inside item */
    /* Same height as YouTube videos for uniformity */
    .video-item iframe {
        width: 100%;
        height: 380px; /* same as YouTube videos */
        border-radius: 12px;
    }


/* Mobile styles */
@media (max-width: 768px) {
    .footer-text {
        text-align: center; /* align text to the right */
        font-size: 0.7rem; /* smaller text for mobile */
        max-width: 100px; /* force text to wrap into two lines */
        word-wrap: break-word; /* allow breaking long words */
        margin-top: 0.3rem; /* spacing below controls */
    }

    /* Flex layout for mobile footer */
    .footer-inner {
        display: flex; /* use flexbox */
        flex-direction: column; /* stack items vertically */
        align-items: flex-end; /* align items to the right */
    }
}