/* Di-Zen Client Portal — shared theme matching index.html */

:root {
    --bg-base: #0a0a0a;
    --bg-surface: #141414;
    --bg-surface-light: #1f1f1f;
    --gold-gradient: linear-gradient(135deg, #bf953f 0%, #fcf6ba 25%, #b38728 50%, #fbf5b7 75%, #aa771c 100%);
    --gold-gradient-hover: linear-gradient(135deg, #fcf6ba 0%, #bf953f 25%, #fbf5b7 50%, #aa771c 75%, #b38728 100%);
    --gold-soft: rgba(191, 149, 63, 0.25);
    --border-subtle: rgba(255, 255, 255, 0.05);
    --border-gold: rgba(191, 149, 63, 0.3);
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.72);
    --danger: #e85d5d;
    --success: #5dce8a;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.portal-body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-base);
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(191, 149, 63, 0.12), transparent),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(191, 149, 63, 0.05), transparent);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.5px;
    margin: 0 0 0.75rem;
}

a {
    color: var(--text-main);
    text-decoration: none;
    transition: opacity 0.25s ease;
}

a:hover {
    opacity: 0.75;
}

.text-gradient {
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.text-muted {
    color: var(--text-muted) !important;
}

.divider {
    width: 64px;
    height: 3px;
    background: var(--gold-gradient);
    margin: 0 0 1.75rem;
}

.divider.center {
    margin-left: auto;
    margin-right: auto;
}

/* ——— Layout ——— */
.portal-wrap {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 0 0 4rem;
}

.portal-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-gold);
    margin-bottom: 2.5rem;
}

.portal-nav-inner {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
    flex-wrap: wrap;
}

.portal-brand {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -1px;
    text-transform: uppercase;
    color: #fff;
}

.portal-brand:hover {
    opacity: 1;
}

.portal-nav-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.portal-nav-user {
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: clamp(1.6rem, 3vw, 2.25rem);
    margin-bottom: 0.5rem;
}

.page-header p {
    margin: 0;
    color: var(--text-muted);
    max-width: 36rem;
    line-height: 1.6;
}

/* ——— Buttons ——— */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 0.8rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-decoration: none;
    padding: 0.85rem 1.5rem;
    transition: all 0.3s ease;
    line-height: 1.2;
}

.btn:hover {
    opacity: 1;
    text-decoration: none;
}

.btn-gold {
    background: var(--gold-gradient);
    color: #000 !important;
}

.btn-gold:hover {
    background: var(--gold-gradient-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(191, 149, 63, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--text-main) !important;
    border: 1px solid var(--border-gold);
}

.btn-outline:hover {
    border-color: #fcf6ba;
    background: rgba(191, 149, 63, 0.08);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted) !important;
    border: 1px solid transparent;
    padding: 0.55rem 0.9rem;
    font-size: 0.75rem;
}

.btn-ghost:hover {
    color: #fff !important;
    border-color: var(--border-subtle);
}

.btn-sm {
    padding: 0.55rem 1rem;
    font-size: 0.72rem;
}

.btn-block {
    width: 100%;
}

.btn-danger {
    background: rgba(232, 93, 93, 0.9);
    color: #fff !important;
}

.btn-danger:hover {
    background: #e85d5d;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(232, 93, 93, 0.28);
}

.btn-danger-outline {
    background: transparent;
    color: #ffb4b4 !important;
    border: 1px solid rgba(232, 93, 93, 0.45);
}

.btn-danger-outline:hover {
    background: rgba(232, 93, 93, 0.12);
    border-color: rgba(232, 93, 93, 0.75);
    transform: translateY(-1px);
}

.admin-upload-panel {
    max-width: 640px;
    margin-bottom: 0.5rem;
}

.admin-photo-meta {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.admin-photo-name {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-photo-size {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
}

/* ——— Cards / surfaces ——— */
.surface {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 1.75rem;
}

.surface-base {
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
}

.alert {
    border-radius: 8px;
    padding: 0.9rem 1.1rem;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.alert-error {
    background: rgba(232, 93, 93, 0.1);
    border-color: rgba(232, 93, 93, 0.35);
    color: #ffb4b4;
}

.alert-success {
    background: rgba(93, 206, 138, 0.1);
    border-color: rgba(93, 206, 138, 0.35);
    color: #b8f0ce;
}

.alert-info {
    background: rgba(191, 149, 63, 0.1);
    border-color: var(--border-gold);
    color: #f5e7b2;
}

/* ——— Forms ——— */
.form-group {
    margin-bottom: 1.15rem;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.45rem;
}

.form-control {
    width: 100%;
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    padding: 0.85rem 1rem;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.form-control:focus {
    border-color: rgba(191, 149, 63, 0.55);
    box-shadow: 0 0 0 3px rgba(191, 149, 63, 0.12);
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23bf953f' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

input[type="file"].form-control {
    padding: 0.7rem;
}

input[type="file"].form-control::file-selector-button {
    background: var(--bg-surface-light);
    border: 1px solid var(--border-gold);
    border-radius: 4px;
    color: var(--text-main);
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 0.45rem 0.9rem;
    margin-right: 0.85rem;
    cursor: pointer;
}

/* ——— Login ——— */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.login-card {
    width: min(420px, 100%);
    background: var(--bg-surface);
    border: 1px solid var(--border-gold);
    border-radius: 10px;
    padding: 2.5rem 2rem;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gold-gradient);
}

.login-brand {
    text-align: center;
    margin-bottom: 0.5rem;
}

.login-brand .portal-brand {
    font-size: 2rem;
}

.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0 0 2rem;
    letter-spacing: 0.04em;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ——— Project cards (dashboard) ——— */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.project-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 0;
    position: relative;
    overflow: hidden;
    transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
    display: flex;
    flex-direction: column;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gold-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s ease;
    z-index: 2;
}

.project-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-gold);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.4);
}

.project-card:hover::before {
    transform: scaleX(1);
}

.project-cover {
    display: block;
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--bg-base);
}

.project-cover:hover {
    opacity: 1;
}

.project-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.55s ease, filter 0.55s ease;
    filter: grayscale(12%) contrast(108%);
}

.project-card:hover .project-cover img {
    transform: scale(1.06);
    filter: grayscale(0%) contrast(100%);
}

.project-cover-placeholder {
    width: 100%;
    height: 100%;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(135deg, rgba(191, 149, 63, 0.12), transparent 60%),
        var(--bg-base);
}

.project-cover-placeholder i {
    font-size: 2.25rem;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.project-card-body {
    padding: 1.25rem 1.35rem 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.project-card h3 {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

.project-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.15rem;
    flex: 1;
}

.project-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-right: 1rem;
}

.empty-state {
    text-align: center;
    padding: 4rem 1.5rem;
    background: var(--bg-surface);
    border: 1px dashed var(--border-gold);
    border-radius: 8px;
}

.empty-state i {
    font-size: 2.5rem;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    margin-bottom: 1rem;
}

/* ——— Gallery ——— */
.gallery-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.75rem;
}

.gallery-toolbar-left,
.gallery-toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.1rem;
}

body.has-selection-bar .portal-wrap {
    padding-bottom: 6.5rem;
}

.gallery-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.gallery-item:hover {
    transform: translateY(-4px);
    border-color: var(--border-gold);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4);
}

.gallery-item.is-selected {
    border-color: rgba(191, 149, 63, 0.7);
    box-shadow: 0 0 0 1px rgba(191, 149, 63, 0.35), 0 16px 32px rgba(0, 0, 0, 0.35);
}

.photo-check {
    position: absolute;
    top: 0.65rem;
    left: 0.65rem;
    z-index: 5;
    cursor: pointer;
    margin: 0;
}

.photo-check input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.photo-check-box {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(10, 10, 10, 0.55);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.photo-check-box i {
    font-size: 0.95rem;
    line-height: 1;
}

.photo-check:hover .photo-check-box,
.gallery-item:hover .photo-check-box {
    border-color: rgba(252, 246, 186, 0.7);
    background: rgba(10, 10, 10, 0.75);
}

.photo-check input:checked + .photo-check-box {
    background: var(--gold-gradient);
    border-color: transparent;
    color: #000;
}

.selection-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom));
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--border-gold);
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
}

.selection-bar-inner {
    width: min(1180px, 100%);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.selection-count {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.selection-count strong {
    color: #fff;
    font-weight: 600;
}

.selection-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.gallery-thumb {
    display: block;
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    cursor: zoom-in;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.55s ease, filter 0.55s ease;
    filter: grayscale(15%) contrast(108%);
}

.gallery-item:hover .gallery-thumb img {
    transform: scale(1.06);
    filter: grayscale(0%) contrast(100%);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 10, 10, 0.85) 0%, transparent 55%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0.85rem;
    pointer-events: none;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay span {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.gallery-actions {
    padding: 0.65rem;
}

/* ——— Lightbox ——— */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(5, 5, 5, 0.94);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    user-select: none;
}

.lightbox.hidden {
    display: none;
}

.lightbox-img {
    max-width: min(92vw, 1100px);
    max-height: 78vh;
    object-fit: contain;
    border-radius: 4px;
    transition: opacity 0.15s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.lightbox-btn {
    position: absolute;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 1.4rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.lightbox-btn:hover {
    background: rgba(191, 149, 63, 0.25);
    border-color: var(--border-gold);
}

.lightbox-close { top: 1.25rem; right: 1.25rem; }
.lightbox-prev  { left: 1.25rem; top: 50%; transform: translateY(-50%); }
.lightbox-next  { right: 1.25rem; top: 50%; transform: translateY(-50%); }

.lightbox-bar {
    position: absolute;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    width: min(900px, calc(100% - 2rem));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    background: rgba(20, 20, 20, 0.85);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    backdrop-filter: blur(8px);
}

.lightbox-meta {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.lightbox-meta strong {
    color: #fff;
    font-weight: 600;
}

.lightbox-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.share-menu {
    position: relative;
}

.share-dropdown {
    position: absolute;
    bottom: calc(100% + 0.5rem);
    right: 0;
    min-width: 190px;
    background: var(--bg-surface);
    border: 1px solid var(--border-gold);
    border-radius: 8px;
    padding: 0.35rem;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
    z-index: 20;
}

.share-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    padding: 0.65rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
}

.share-option:hover {
    background: rgba(191, 149, 63, 0.12);
}

.share-option i {
    font-size: 1.05rem;
    width: 1.15rem;
    text-align: center;
    color: #f5e7b2;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 5.5rem;
    transform: translateX(-50%);
    z-index: 10000;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid var(--border-gold);
    color: #fff;
    padding: 0.75rem 1.15rem;
    border-radius: 8px;
    font-size: 0.85rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
    max-width: min(420px, calc(100% - 2rem));
    text-align: center;
}

.share-card {
    width: min(520px, 100%);
}

.share-preview {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    background: var(--bg-base);
}

.share-preview img {
    width: 100%;
    max-height: 55vh;
    object-fit: contain;
    display: block;
}

/* ——— Admin ——— */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

@media (max-width: 768px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }
}

.admin-grid h2 {
    font-size: 1rem;
    margin-bottom: 1.25rem;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: var(--bg-surface);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    padding: 0.95rem 1.1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}

.data-table th {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.25);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    background: rgba(191, 149, 63, 0.15);
    border: 1px solid var(--border-gold);
    color: #f5e7b2;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.back-link:hover {
    color: #fff;
    opacity: 1;
}

@media (max-width: 576px) {
    .login-card {
        padding: 2rem 1.35rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.65rem;
    }

    .lightbox-prev { left: 0.5rem; }
    .lightbox-next { right: 0.5rem; }
    .lightbox-bar {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .lightbox-actions {
        justify-content: center;
        flex-wrap: wrap;
    }

    .share-dropdown {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }
}
