/* ====== Global Reset & Base Setup ====== */

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow-x: hidden;
}

* {
    box-sizing: border-box;
    max-width: 100%;
}


body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: white;
    color: black;
    font-size: clamp(10px, 2.5vw, 14px);
    font-family: 'Inter', sans-serif;
}


/* ====== Wrapper and Content ====== */
.wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.content {
    flex: 1;
    padding: 20px;
}

/* ====== Container for Centered Content ====== */
.container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin: 0 0 0 20px;
}
/* ====== Header ====== */
header {
    width: 100%;
    background-color: whitesmoke;
    color: deepskyblue;
    padding: 0;
    box-sizing: border-box;
}

.header-icons {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.header-icons a,
.header-icons form {
    display: inline-flex;
    align-items: center;
}

.header-icons img {
    width: 32px;
    height: auto;
}

.home-user-header-row {
    flex-wrap: nowrap;
    gap: clamp(8px, 1.5vw, 24px);
    margin: 0 auto;
}

.home-user-header-row > * {
    flex: 0 0 auto;
}

.home-user-header-row p,
.home-user-header-row h1 {
    margin: 0;
    white-space: nowrap;
}

.home-user-header-row h1 {
    font-size: clamp(14px, 1.6vw, 24px);
}

.home-user-header .header-icons {
    flex-wrap: nowrap;
    margin-top: 0;
}

.home-user-header .header-icons form,
.home-user-header .header-icons button {
    width: auto;
    max-width: none;
    margin-top: 0;
    margin-bottom: 0;
    padding: 0;
}

/* ====== Navigation ====== */
nav a {
    color: black;
    text-decoration: none;
    margin: 1rem;
}

nav a:hover {
    text-decoration: underline;
}

/* ====== Footer ====== */
footer {
    background-color: #f2f2f2;
    color: black;
    text-align: center;
    padding: 1rem 0;
    width: 100%;
    box-sizing: border-box;
    margin-top: auto;
}

/* ====== Forms ====== */
form {
    margin: 2rem auto;
    max-width: 400px;
    padding: 1rem;
}

/* Shared input styling */
form input,
form select,
form button {
    padding: 0.5rem;
    margin: 0.5rem 0;
    box-sizing: border-box;
    font-size: 1rem;
}

/* Prevent global 100% width from affecting specific forms */
form:not(.search-form) input,
form:not(.search-form) select,
form:not(.search-form) button {
    width: 100%;
}

/* Specific Forms */
.register-form, .login-form, .all-form {
    width: 300px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

/* ====== Utility Classes ====== */
.top-right {
    position: absolute;
    top: 20px;
    right: 20px;
}

.center-image {
    display: block;
    margin: 0 auto;
}

a {
    margin-right: 15px;
}

/* ====== Icon Buttons ====== */
.icon-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
}

.icon-btn img {
    width: 24px;
    height: 24px;
}

/* ====== Image Ribbon ====== */
.ribbon-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 1000px;
    margin: 1rem auto;
}

.image-ribbon {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    scroll-behavior: smooth;
    padding: 1rem 0;
    flex-grow: 1;
    scrollbar-width: none;
}

.image-ribbon::-webkit-scrollbar {
    display: none;
}

.image-ribbon img {
    flex: 0 0 auto;
    height: 400px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.image-ribbon img:hover {
    transform: scale(1.05);
}

.scroll-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: black;
    cursor: pointer;
    padding: 0;
    margin: 0;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.scroll-btn.left {
    left: 10px;
}

.scroll-btn.right {
    right: 10px;
}

/* ====== Main Page Upwork CTA ====== */
.upwork-cta {
    display: flex;
    justify-content: center;
    margin: 26px auto 6px;
}

.upwork-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 48px;
    padding: 12px 22px;
    border: 1px solid #119a32;
    border-radius: 8px;
    background: linear-gradient(135deg, #14a800 0%, #108a00 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.2;
    text-decoration: none;
    box-shadow: 0 10px 22px rgba(20, 168, 0, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.upwork-button:hover,
.upwork-button:focus {
    background: linear-gradient(135deg, #18b703 0%, #0f7f00 100%);
    box-shadow: 0 14px 28px rgba(20, 168, 0, 0.3);
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-2px);
}

.upwork-button:focus-visible {
    outline: 3px solid rgba(20, 168, 0, 0.35);
    outline-offset: 3px;
}

.upwork-button__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #ffffff;
    color: #14a800;
    font-size: 0.85rem;
    font-weight: 800;
}

.upwork-button__text {
    white-space: nowrap;
}

@media (max-width: 480px) {
    .upwork-button {
        width: 100%;
        padding: 12px 16px;
    }

    .upwork-button__text {
        white-space: normal;
    }
}

/* ====== Lightbox ====== */
#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#lightbox img {
    max-width: 90%;
    max-height: 90%;
    border: 5px solid white;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.9);
    cursor: zoom-out;
    transition: transform 0.3s ease;
}

/* ====== Product Table ====== */
table {
    width: 90%;
    border-collapse: collapse;
    margin: 20px 0;
}

th, td {
    padding: 10px;
    border: 1px solid #ccc;
}

th {
    background-color: #f9f9f9;
}

/* Headings */
h2 {
    font-family: Arial, sans-serif;
}

/* Form override for inline display */
form.inline {
    display: inline;
}

/* Actions section (like cart) */
.actions {
    margin-top: 20px;
}

.form-row-right {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

td:last-child form {
    display: flex;
    justify-content: flex-end;
}

/* ====== Fixed Search Form Styling ====== */
/* === Oval (Pill-Shaped) Search Form === */
.search-form {
    border: 1px solid #ccc;
    border-radius: 999px; /* Make the form oval */
    padding: 4px 8px;
    background-color: white;
}

.search-form input {
    border: none;
    outline: none;
    border-radius: 999px; /* Smooth input edge */
    padding: 8px 12px;
    font-size: 14px;
    background-color: transparent;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-form button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.search-form button:hover {
    background-color: #f0f0f0;
}

.cart-icon-wrapper {
    position: relative;
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -10px;
    background-color: red;
    color: white;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 50%;
}
.oval-form {
    padding: 20px;
    background-color: white;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.oval-form input {
    border: none;
    outline: none;
    border-radius: 999px;
    padding: 10px 15px;
    font-size: 14px;
    background-color: #f9f9f9;
}
.oval-form button {
    border: none;
    border-radius: 999px;
    padding: 10px;
    background-color: #007bff;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
}
.oval-form button:hover {
    background-color: #0056b3;
}
/* Style the label to align its contents vertically */
.oval-label {
    display: flex;
    flex-direction: column;
    font-size: 14px;
    gap: 5px;
}

/* Style the select box to look like a pill */
.oval-label select {
    border: none;
    outline: none;
    border-radius: 999px;
    padding: 10px 15px;
    font-size: 14px;
    background-color: #f9f9f9;
}

/* ====== Shared site design system ====== */
:root {
    --site-color-bg: #ffffff;
    --site-color-surface: #f8fafc;
    --site-color-ink: #0f172a;
    --site-color-muted: #475569;
    --site-color-accent: #2563eb;
    --site-color-accent-dark: #1d4ed8;
    --site-color-border: #e2e8f0;
    --site-shell: 1200px;
    --site-radius-sm: 0.5rem;
    --site-radius-md: 0.875rem;
    --site-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.05);
    --site-transition: 180ms ease;
}

body {
    min-width: 320px;
    background: var(--site-color-bg);
    color: var(--site-color-ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

body > main,
body > .content,
.wrapper > .content {
    width: min(calc(100% - 2rem), var(--site-shell));
    margin-inline: auto;
}

.wrapper { width: 100%; }

h1, h2, h3 {
    color: var(--site-color-ink);
    font-family: inherit;
    line-height: 1.2;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.35rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); }

a { color: var(--site-color-accent); transition: color var(--site-transition); }
a:hover, a:focus-visible { color: var(--site-color-accent-dark); }

button, input, select, textarea { font: inherit; }

input, select, textarea {
    border: 1px solid var(--site-color-border);
    border-radius: var(--site-radius-sm);
    background: #fff;
    color: var(--site-color-ink);
}

button, .btn {
    border: 1px solid var(--site-color-accent);
    border-radius: var(--site-radius-sm);
    background: var(--site-color-accent);
    color: #fff;
    font-weight: 700;
    transition: background var(--site-transition), border-color var(--site-transition), transform var(--site-transition);
}

button:hover, .btn:hover {
    border-color: var(--site-color-accent-dark);
    background: var(--site-color-accent-dark);
    color: #fff;
}

:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.45); outline-offset: 3px; }

/* Role-aware links remain page-specific; their presentation is shared. */
body > header,
.wrapper > header {
    width: 100%;
    min-height: 5rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--site-color-border);
    padding: 0 !important;
    background: rgba(255, 255, 255, 0.96) !important;
    color: var(--site-color-ink);
    font-size: 0.9375rem !important;
}

.site-header__inner {
    min-height: 5rem;
    display: flex;
    align-items: center;
}

.site-header__nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

header > .container,
header > .site-shell {
    width: min(calc(100% - 2rem), var(--site-shell));
    min-height: 5rem;
    margin: 0 auto !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(0.65rem, 1.5vw, 1.5rem);
}

header > a { margin-left: max(1rem, calc((100% - var(--site-shell)) / 2)) !important; }

header a,
header a h1,
header a h2 {
    min-height: 2.5rem;
    display: inline-flex;
    align-items: center;
    margin: 0;
    color: var(--site-color-muted);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
}

header a:hover, header a:focus-visible { color: var(--site-color-accent); text-decoration: none; }
header h1, header h2, header p { margin-block: 0; }
header .header-icons { flex-wrap: wrap; gap: 0.75rem; margin: 0; }

header .header-icons form,
header .search-form { width: auto; margin: 0; padding: 0; }

.site-shell {
    width: min(calc(100% - 2rem), var(--site-shell));
    margin-inline: auto;
}

.site-footer {
    width: 100%;
    margin-top: auto;
    border-top: 1px solid var(--site-color-border);
    background: var(--site-color-surface);
    color: var(--site-color-muted);
}

.site-footer__inner {
    min-height: 7rem;
    display: grid;
    align-items: center;
    gap: 1rem 2rem;
    padding-block: 2rem;
}

.site-footer__links { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; }

.site-footer__links a {
    margin: 0;
    color: var(--site-color-muted);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
}

.site-footer__links a:hover, .site-footer__links a:focus-visible { color: var(--site-color-accent); }
.site-footer__copyright { margin: 0; color: var(--site-color-muted); font-size: 0.875rem; }

table { max-width: 100%; overflow-wrap: anywhere; }

@media (min-width: 640px) {
    .site-footer__inner { grid-template-columns: 1fr auto; }
    .site-footer__copyright { text-align: right; }
}

@media (max-width: 767px) {
    body > header, .wrapper > header, header > .container, header > .site-shell { min-height: 4.5rem; }

    header > .container,
    header > .site-shell {
        align-items: flex-start;
        flex-direction: column;
        padding-block: 0.75rem;
    }

    header .header-icons, header nav { width: 100%; overflow-x: auto; }
    .site-footer__inner { min-height: 0; padding-block: 1.5rem; }
}

/* ====== Admin dashboard ====== */
/* Grow with content: a fixed-height flex body shrank the header and wrapper,
   so <main> overlapped the nav links and the footer overlapped the form. */
body.admin-page { height: auto; }

.admin-page__wrapper { min-height: 0; flex: 1 0 auto; }

.admin-header {
    min-height: 0;
    flex-shrink: 0;
    border-bottom: 1px solid var(--site-color-border);
}

.admin-header__row {
    min-height: 5rem;
    flex-wrap: nowrap;
    overflow: hidden;
}

.admin-nav {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

.admin-nav__inner {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.5rem;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    padding-block: 0.65rem;
    scrollbar-width: thin;
}

.admin-nav__inner a {
    min-height: 2.5rem;
    flex: 0 0 auto;
    padding: 0.45rem 0.7rem;
    border-radius: var(--site-radius-sm);
    white-space: nowrap;
    color: var(--site-color-muted);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
}

.admin-nav__inner a:hover,
.admin-nav__inner a:focus-visible {
    background: var(--site-color-surface);
    color: var(--site-color-accent);
}

.admin-identity {
    min-width: 0;
    max-width: 40%;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-identity__value {
    min-width: 0;
    overflow: hidden;
    color: var(--site-color-ink);
    font-size: 0.9375rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-logout {
    width: auto;
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
}

.admin-logout button {
    width: auto !important;
    min-height: 2.5rem;
    margin: 0;
    border-color: transparent;
    background: transparent;
    padding: 0.45rem 0.7rem;
    color: var(--site-color-muted);
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
}

.admin-logout button:hover,
.admin-logout button:focus-visible {
    border-color: transparent;
    background: var(--site-color-surface);
    color: var(--site-color-accent);
}

.admin-content { padding-block: clamp(2rem, 5vw, 4rem); }
.admin-summary { display: flex; justify-content: center; }

.admin-visit-count {
    border: 1px solid var(--site-color-border);
    border-radius: var(--site-radius-md);
    background: var(--site-color-surface);
    padding: 0.9rem 1.15rem;
    text-align: center;
    box-shadow: var(--site-shadow-sm);
}

.admin-resource-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-block: 1.5rem 2.5rem;
}

.admin-resource-links a {
    margin: 0;
    border: 1px solid var(--site-color-border);
    border-radius: var(--site-radius-sm);
    padding: 0.6rem 0.9rem;
    background: #fff;
    color: var(--site-color-ink);
    font-weight: 600;
    text-decoration: none;
}

.admin-resource-links a:hover,
.admin-resource-links a:focus-visible { border-color: var(--site-color-accent); color: var(--site-color-accent); }
.admin-content__heading { margin: 0 0 1.25rem; text-align: center; }

/* ====== Image administration ====== */
.image-admin {
    width: min(calc(100% - 2rem), var(--site-shell));
    margin-inline: auto;
    padding-block: clamp(2rem, 5vw, 4rem);
}

.image-admin__title { margin: 0 0 1.5rem; }

.image-upload-form {
    max-width: 38rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    border: 1px solid var(--site-color-border);
    border-radius: var(--site-radius-md);
    background: var(--site-color-surface);
    padding: 1rem;
}

.image-upload-form input,
.image-upload-form button { width: 100%; min-width: 0; margin: 0; }
.image-upload-form button { width: auto; white-space: nowrap; }

.image-admin__divider {
    margin-block: clamp(2rem, 5vw, 3.5rem);
    border: 0;
    border-top: 1px solid var(--site-color-border);
}

.uploaded-images h2 { margin: 0 0 1.5rem; }

.uploaded-images__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
    gap: 1.5rem;
}

.uploaded-image-card {
    min-width: 0;
    overflow: hidden;
    display: grid;
    grid-template-rows: minmax(13rem, 1fr) auto;
    border: 1px solid var(--site-color-border);
    border-radius: var(--site-radius-md);
    background: #fff;
    padding: 0.75rem;
    box-shadow: var(--site-shadow-sm);
}

.uploaded-image-card > img {
    width: 100%;
    height: 14rem;
    display: block;
    object-fit: contain;
    border-radius: calc(var(--site-radius-md) - 0.25rem);
    background: var(--site-color-surface);
}

.uploaded-image-card__delete {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0.75rem 0 0;
}

.uploaded-image-card__delete button { width: 100%; margin: 0; }

/* ====== Human verification ====== */
.verification-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background: #fff;
}

.verification-page__content { width: min(100%, 32rem); text-align: center; }
.verification-page__content h2,
.verification-page > h3 { margin: 0; text-align: center; }

@media (max-width: 639px) {
    .admin-header > .admin-header__row {
        min-height: 4.5rem;
        flex-direction: row;
        align-items: center;
        padding-block: 0 !important;
    }
    .admin-identity { max-width: 55%; }
    .image-upload-form { grid-template-columns: 1fr; }
    .image-upload-form button { width: 100%; }
}

