/* style.css */
:root {
     --bg: #0b1116; /* page background */
     /* Set this to your image file. Example: url("assets/bg.jpg") or an absolute URL.
         Drop your image at `assets/bg.jpg` in the project or replace the value below. */
    --bg-image: url("https://wallpapercave.com/wp/wp8879567.jpg");
     /* Allow switching the focal position for small screens so subjects near the
         bottom (like a car) don't get cropped as much. */
     --bg-position: center center;
     --surface: rgba(255,255,255,0.03); /* panels */
     --accent: #66d3ff; /* light blue accent */
     --accent-2: #2ea6ff;
     --text: #e6f3fb;
     --muted: #98a7b1;
     --radius: 10px;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: Inter, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    /* allow scrolling when content exceeds viewport (needed for preview) */
    overflow: auto;
    position: relative;
}

/* Full-page background image layer.
   Use the `--bg-image` variable (defined above) to point to your file or an external URL.
   The image is placed in a ::before pseudo-element so the existing vignette (body::after)
   and other overlay elements continue to work as expected. */
body::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--bg-image);
    background-size: cover;
    background-position: var(--bg-position);
    background-repeat: no-repeat;
    /* On large screens keep the background fixed for a parallax feeling; on small
       screens use scroll to avoid janky behavior. */
    background-attachment: fixed;
    z-index: -2; /* behind the vignette (body::after has -1) and behind content */
    pointer-events: none;
}

@media (max-width: 720px) {
    /* On small screens avoid fixed backgrounds and favor showing the lower part
       of the image (helps when the subject is at the bottom of the photo). */
    body::before { background-attachment: scroll; --bg-position: center bottom; }
}

/* Remove decorative floating orbs (small dots). This hides them while keeping the
   original code in place in case you want to re-enable later. */
.orbs { display: none !important; }

/* Entrance animations when page loads */
.is-loaded body, .is-loaded main, .is-loaded #top-bar {
    opacity: 1;
    transform: none;
}

html:not(.is-loaded) body, html:not(.is-loaded) main, html:not(.is-loaded) #top-bar {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 520ms cubic-bezier(.2,.9,.2,1), transform 520ms cubic-bezier(.2,.9,.2,1);
}

.orbs {
    position: absolute;
    width: var(--size, 18px);
    height: var(--size, 18px);
    background: linear-gradient(135deg, rgba(102,211,255,0.08), rgba(46,166,255,0.06));
    border-radius: 50%;
    /* support multiple animations (float across, small drift) */
    animation: float linear infinite, drift ease-in-out infinite;
    transform-origin: center;
    pointer-events: none;
    will-change: transform, opacity, left, top;
}

@keyframes float {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    100% {
        transform: translate3d(30vw, 30vh, 0) scale(0.95);
    }
}

@keyframes drift {
    0% { transform: translate3d(0, 0, 0) rotate(0deg); }
    25% { transform: translate3d(-6px, -4px, 0) rotate(-3deg); }
    50% { transform: translate3d(0, 6px, 0) rotate(0deg); }
    75% { transform: translate3d(6px, -2px, 0) rotate(2deg); }
    100% { transform: translate3d(0, 0, 0) rotate(0deg); }
}

/* subtle depth layering so orbs feel 3D */
.orbs { box-shadow: 0 6px 24px rgba(2,8,18,0.35) inset, 0 4px 10px rgba(0,0,0,0.35); }

/* subtle vignette */
body::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(1200px 600px at 10% 10%, rgba(46,66,80,0.06), transparent 20%, rgba(0,0,0,0.35));
    z-index: -1;
}

#top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    /* increased right padding so the About button doesn't get clipped on some screens */
    padding: 16px 28px 16px 20px;
    background: rgba(10,14,18,0.6);
    backdrop-filter: blur(6px);
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 6px 18px rgba(2,6,12,0.6);
}

.logo-text {
    display: flex;
    align-items: center;
    margin-right: auto; /* push the About button more to the left */
}

/* Ensure About button isn't clipped on very narrow viewports */
@media (max-width: 420px) {
    #top-bar {
        padding-right: 18px; /* slightly reduce padding on tiny screens */
    }
    #about-button {
        padding: 8px 10px;
        font-size: 0.9rem;
        margin-left: 6px;
    }
}

h1 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.6px;
    margin-right: 12px; /* Space between text and logo */
}

.logo {
    width: 48px;
    height: auto;
}

/* Centered large duplicate logo placed above the main box */
.center-logo-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 28px;
    z-index: 2;
    pointer-events: none;
}

.center-logo {
    width: 240px;
    max-width: 56vw;
    height: auto;
    filter: drop-shadow(0 10px 30px rgba(0,0,0,0.6));
}

/* gentle pulse animation for the large center logo */
.center-logo {
    animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        transform: translateY(-6%) scale(1);
        filter: drop-shadow(0 8px 24px rgba(0,0,0,0.6));
    }
    50% {
        transform: translateY(-6%) scale(1.03);
        filter: drop-shadow(0 12px 30px rgba(0,0,0,0.7));
    }
    100% {
        transform: translateY(-6%) scale(1);
        filter: drop-shadow(0 8px 24px rgba(0,0,0,0.6));
    }
}

/* Smooth focus rings for accessibility */
input[type="text"]:focus, input[type="password"]:focus, button:focus {
    outline: none;
    box-shadow: 0 6px 18px rgba(46,163,255,0.09), 0 0 0 3px rgba(46,163,255,0.06);
}

#about-button {
    padding: 8px 14px;
    background: transparent;
    border: 1px solid rgba(110,160,200,0.12);
    color: var(--text);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.18s, transform 0.08s, box-shadow 0.18s;
    margin-left: 8px;
    margin-right: 30px; /* small gap from right-aligned content */
}

#about-button:hover {
    background: rgba(110,160,200,0.06);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(46,118,160,0.06);
}

main {
    width: 100%;
    max-width: 720px;
    padding: 28px 26px;
    margin-top: 84px;
    position: relative;
    z-index: 1;
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(3,6,10,0.6);
    /* allow the main panel to size naturally */
}

main p {
    font-size: 1.05rem;
    color: var(--muted);
    margin: 0 0 12px 0;
}

form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

input[type="text"], input[type="password"] {
    padding: 12px 14px;
    /* responsive: allow inputs to fill narrow screens but limit width on larger viewports */
    width: 100%;
    max-width: 360px;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    background-color: rgba(255,255,255,0.02);
    color: var(--text);
    font-size: 1rem;
    transition: border-color 0.18s, box-shadow 0.18s;
    box-sizing: border-box;
}

input[type="text"]:focus, input[type="password"]:focus {
    border-color: var(--accent-2);
    outline: none;
    box-shadow: 0 6px 18px rgba(46,163,255,0.06);
}

button {
    padding: 10px 18px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    border: none;
    border-radius: 10px;
    color: #04202a;
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(46,163,255,0.08);
}

/* Toast notifications */
#toast {
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(12px);
    background: linear-gradient(90deg, rgba(30,45,60,0.98), rgba(18,28,36,0.98));
    color: var(--text);
    padding: 12px 18px;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.6);
    max-width: calc(100% - 40px);
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 280ms ease, transform 280ms cubic-bezier(.2,.9,.2,1);
    z-index: 80;
}

#toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* Dev panel and about modal styling moved from inline attributes */
#dev-panel {
    display: none;
    max-width: 800px;
    padding: 20px;
    background: rgba(30, 30, 30, 0.9);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 70;
    overflow-y: auto;
    max-height: 80vh;
}

/* About modal overlay — darker and slightly blurred to focus the modal */
#about-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.96); /* very dark overlay */
    backdrop-filter: blur(6px); /* subtle blur behind the overlay */
    -webkit-backdrop-filter: blur(6px);
    z-index: 220; /* higher so it's unambiguously above UI elements */
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-inner {
    /* Solid, fully opaque inner panel for maximum contrast */
    background: #080c10; /* fully opaque dark surface */
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(255,255,255,0.04);
}

/* Reduce or disable animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    .orbs { animation: none; }
    .center-logo { animation: none; }
    @keyframes float { from { transform: none; } to { transform: none; } }
    @keyframes pulse { from { transform: none; } to { transform: none; } }
    html:not(.is-loaded) body, html:not(.is-loaded) main, html:not(.is-loaded) #top-bar { transition: none; opacity: 1; transform: none; }
}

#preview-section {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    position: relative;
    z-index: 1;
    /* allow the preview area to scroll if iframe is tall */
    max-height: 70vh;
    overflow-y: auto;
    padding: 10px;
    box-sizing: border-box;
}

#preview-section p {
    font-size: 1rem;
    color: var(--muted);
    padding: 6px 0 0 0;
}

#preview-video {
    max-width: 100%;
    width: 100%;
    max-height: 60vh; /* keep iframe from exceeding viewport */
    height: auto;
    border: 2px solid #444;
    border-radius: 6px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.7);
}


/* Minimal footer */
#site-footer {
    width: 100%;
    background: transparent;
    padding: 10px 6px;
    box-sizing: border-box;
    color: var(--muted);
    position: relative;
}

/* Additional tweaks for small phones */
@media (max-width: 480px) {
    main {
        padding: 18px 14px;
        margin-top: 68px;
        border-radius: 8px;
    }
    .center-logo {
        width: 140px;
        max-width: 46vw;
    }
    /* Make the top bar more compact and avoid clipped content */
    #top-bar {
        padding: 10px 12px;
    }
    h1 { font-size: 1.05rem; margin-right: 8px; }
    /* On very small screens hide the h1 text (logo image remains) to save space */
    @media (max-width: 360px) {
        .logo-text h1 { display: none; }
    }
}

.edit-entry {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 15px;
    text-align: left;
}

.edit-entry label {
    font-size: 1em;
    color: #ddd;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);
}

.edit-entry input {
    padding: 8px;
    border: 1px solid #444;
    border-radius: 4px;
    background-color: #3c3c3c;
    color: #ffffff;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

#dev-panel h2 {
    font-size: 1.3rem;
    color: var(--text);
}

#dev-panel p {
    font-size: 1rem;
    color: var(--muted);
    padding: 8px 0;
}


#about-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2,6,10,0.6);
    z-index: 60;
    align-items: center;
    justify-content: center;
}

#about-modal h2 {
    font-size: 1.3rem;
    color: var(--text);
    margin: 0 0 8px 0;
}

#about-modal p {
    font-size: 1rem;
    color: var(--muted);
    padding: 6px 0 14px 0;
}

#about-modal > div {
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    padding: 22px 26px;
    border-radius: calc(var(--radius) - 2px);
    max-width: 520px;
    text-align: center;
    box-shadow: 0 18px 50px rgba(2,8,18,0.6);
}
