/* SGN Cloud main stylesheet */

:root {
    --bg: #050816;
    --bg-alt: #0f172a;
    --fg: #e5e7eb;
    --fg-muted: #9ca3af;
    --accent: #3b82f6;
    --danger: #ef4444;
    --card-bg: #020617;
    --border: #1e293b;
    --radius-lg: 1.5rem;
    --radius-md: 0.75rem;
    --transition-fast: 0.2s ease;
    --transition-med: 0.3s ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #1d3a8a 0, #020617 45%, #000 100%);
    color: var(--fg);
    min-height: 100vh;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(16px);
    background: rgba(2, 6, 23, 0.85);
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 0, #60a5fa 0, #1d4ed8 40%, #020617 100%);
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 0 0 1px rgba(191, 219, 254, 0.3);
}

.brand-text {
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: var(--fg-muted);
}

.topbar-nav {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    font-size: 0.9rem;
}

.topbar-nav a {
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    border: 1px solid transparent;
    color: var(--fg-muted);
    transition: border-color var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
}

.topbar-nav a:hover {
    border-color: rgba(148, 163, 184, 0.5);
    background: rgba(15, 23, 42, 0.9);
    color: var(--fg);
}

.user-label {
    color: var(--fg-muted);
    margin-right: 0.75rem;
}

/* Layout */
.content {
    max-width: 1100px;
    margin: 1.5rem auto 2.5rem;
    padding: 0 1.25rem;
}

/* Page titles */
.page-title {
    font-size: 1.6rem;
    margin-bottom: 1.25rem;
    text-shadow: 0 18px 40px rgba(15, 23, 42, 0.9);
}

/* Album grid */
.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1.1rem;
}

.album-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    background: radial-gradient(circle at top, rgba(37, 99, 235, 0.25), rgba(15, 23, 42, 0.9));
    border: 1px solid rgba(51, 65, 85, 0.8);
    overflow: hidden;
    position: relative;
    padding: 0.9rem;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.album-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(96, 165, 250, 0.35), transparent 55%);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.album-card:hover {
    transform: translateY(-3px) translateZ(0);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.9);
    border-color: rgba(129, 140, 248, 0.8);
    text-decoration: none;
}

.album-card:hover::before {
    opacity: 1;
}

.album-cover {
    height: 150px;
    border-radius: calc(var(--radius-lg) - 0.35rem);
    background: linear-gradient(135deg, var(--album-color, var(--accent)), #1e293b);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    position: relative;
    overflow: hidden;
}

.album-cover::after {
    content: "";
    position: absolute;
    width: 160%;
    height: 160%;
    background: radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.25), transparent 55%);
    opacity: 0.15;
    transform: translate3d(-15%, -10%, 0);
}

.album-cover-icon {
    font-size: 2.2rem;
}

.album-meta h2 {
    margin: 0 0 0.3rem;
    font-size: 1.05rem;
}

.album-desc {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
    color: var(--fg-muted);
}

.album-access {
    margin: 0;
    font-size: 0.8rem;
    color: var(--fg-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.9rem;
    cursor: pointer;
    background: transparent;
    color: var(--fg);
    transition: background var(--transition-med), border-color var(--transition-med), transform 0.1s ease;
}

.btn.primary {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    border-color: rgba(129, 140, 248, 0.9);
    box-shadow: 0 16px 40px rgba(37, 99, 235, 0.6);
}

.btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 60px rgba(37, 99, 235, 0.8);
}

.btn.secondary {
    border-color: rgba(148, 163, 184, 0.6);
    background: rgba(15, 23, 42, 0.9);
    color: var(--fg-muted);
}

.btn.secondary:hover {
    border-color: rgba(148, 163, 184, 0.9);
    color: var(--fg);
}

.btn.danger {
    border-color: rgba(248, 113, 113, 0.8);
    color: #fecaca;
}

.btn.danger:hover {
    background: rgba(248, 113, 113, 0.18);
}

.btn.small {
    padding: 0.25rem 0.7rem;
    font-size: 0.8rem;
}

.btn.full {
    width: 100%;
    justify-content: center;
}

/* Forms */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 0.48rem 0.6rem;
    border-radius: 0.6rem;
    border: 1px solid rgba(51, 65, 85, 0.9);
    background: rgba(15, 23, 42, 0.95);
    color: var(--fg);
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(96, 165, 250, 0.9);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.5);
    background: #020617;
}

label {
    display: block;
    margin: 0.45rem 0 0.2rem;
    font-size: 0.85rem;
    color: var(--fg-muted);
}

.card {
    background: rgba(2, 6, 23, 0.95);
    border-radius: var(--radius-lg);
    padding: 1rem 1.05rem;
    border: 1px solid rgba(51, 65, 85, 0.95);
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.95);
    margin-bottom: 1rem;
}

/* Messages */
.error {
    background: rgba(248, 113, 113, 0.15);
    border-left: 3px solid var(--danger);
    padding: 0.6rem 0.8rem;
    border-radius: 0.7rem;
    font-size: 0.85rem;
    color: #fecaca;
    margin: 0.5rem 0;
}

.success {
    background: rgba(34, 197, 94, 0.16);
    border-left: 3px solid #22c55e;
    padding: 0.6rem 0.8rem;
    border-radius: 0.7rem;
    font-size: 0.85rem;
    color: #bbf7d0;
    margin: 0.5rem 0;
}

.hint {
    font-size: 0.78rem;
    color: var(--fg-muted);
}

/* Album header */
.album-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1.2rem;
    background: linear-gradient(90deg, var(--album-color, #3b82f6), rgba(15, 23, 42, 0.95));
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.9);
}

.album-title {
    margin: 0;
    font-size: 1.2rem;
}

/* Icon button (hamburger) */
.icon-button {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.9);
    background: rgba(15, 23, 42, 0.4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    color: inherit;
    padding: 0;
}

.icon-button span {
    display: block;
    width: 1.1rem;
    height: 2px;
    background: white;
    border-radius: 999px;
    position: absolute;
    transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.icon-button span:nth-child(1) { transform: translateY(-5px); }
.icon-button span:nth-child(2) { transform: translateY(0); }
.icon-button span:nth-child(3) { transform: translateY(5px); }

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: -260px;
    width: 260px;
    height: 100%;
    background: rgba(15, 23, 42, 0.98);
    border-right: 1px solid rgba(51, 65, 85, 0.9);
    box-shadow: 18px 0 45px rgba(15, 23, 42, 0.9);
    transition: transform var(--transition-med);
    transform: translateX(0);
    z-index: 25;
}

.sidebar.open {
    transform: translateX(260px);
}

.sidebar-inner {
    padding: 1rem 1rem 2rem;
}

.sidebar-close {
    position: absolute;
    right: 0.6rem;
    top: 0.6rem;
    font-size: 1.4rem;
    background: transparent;
    border: none;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-med);
    z-index: 20;
}

.sidebar-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.nav-links {
    list-style: none;
    padding: 0;
    margin: 2.4rem 0 0;
}

.nav-links li {
    margin-bottom: 0.4rem;
}

.nav-links a {
    display: block;
    padding: 0.4rem 0.4rem;
    border-radius: 0.6rem;
    color: var(--fg-muted);
    font-size: 0.9rem;
}

.nav-links a:hover {
    background: rgba(30, 64, 175, 0.7);
    color: #e5e7eb;
}

/* Gallery */
.gallery {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.4rem;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: zoom-in;
    border: 1px solid rgba(30, 64, 175, 0.6);
    background: radial-gradient(circle at top, rgba(37, 99, 235, 0.35), rgba(15, 23, 42, 0.9));
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-item:hover {
    transform: translateY(-2px);
    border-color: rgba(129, 140, 248, 0.9);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.9);
}

.video-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.8rem 0;
    font-size: 1.5rem;
    color: #e5e7eb;
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.98);
    transition: opacity var(--transition-med), visibility var(--transition-med), transform var(--transition-med);
    z-index: 40;
}

.lightbox.open {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-med);
    z-index: 35;
}

.lightbox-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content {
    position: relative;
    max-width: 96vw;
    max-height: 92vh;
    background: rgba(15, 23, 42, 0.96);
    border-radius: var(--radius-lg);
    padding: 0.6rem 0.6rem 0.9rem;
    border: 1px solid rgba(51, 65, 85, 0.95);
    box-shadow: 0 28px 70px rgba(15, 23, 42, 1);
    display: flex;
    flex-direction: column;
}

.lightbox-media {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60vw;
    min-height: 40vh;
}

.lightbox-media img,
.lightbox-media video {
    max-width: 100%;
    max-height: 70vh;
    border-radius: var(--radius-md);
}

.lightbox-close {
    position: absolute;
    right: 0.4rem;
    top: 0.4rem;
    font-size: 1.3rem;
    background: transparent;
    border: none;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(15, 23, 42, 0.85);
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    width: 2.1rem;
    height: 2.1rem;
    font-size: 1.2rem;
}

.lightbox-prev { left: 0.25rem; }
.lightbox-next { right: 0.25rem; }

.lightbox-footer {
    margin-top: 0.4rem;
    display: flex;
    justify-content: flex-end;
}

/* Modal (download all) */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity var(--transition-med), visibility var(--transition-med), transform var(--transition-med);
    z-index: 30;
}

.modal.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-med);
    z-index: 25;
}

.modal-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: rgba(2, 6, 23, 0.98);
    border-radius: var(--radius-lg);
    padding: 1rem 1.2rem 1.2rem;
    border: 1px solid rgba(51, 65, 85, 0.95);
    box-shadow: 0 28px 70px rgba(15, 23, 42, 1);
    max-width: 420px;
    width: 90%;
    position: relative;
}

.modal-close {
    position: absolute;
    right: 0.4rem;
    top: 0.4rem;
    font-size: 1.2rem;
    background: transparent;
    border: none;
}

.modal-actions {
    margin-top: 0.7rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.download-help {
    margin-top: 0.6rem;
    font-size: 0.8rem;
    color: var(--fg-muted);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-med);
}

.download-help.visible {
    max-height: 200px;
}

/* Admin layout */
.admin-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 1rem;
}

.admin-sidebar {
    background: rgba(15, 23, 42, 0.95);
    border-radius: var(--radius-lg);
    padding: 0.9rem;
    border: 1px solid rgba(51, 65, 85, 0.95);
    box-shadow: 0 18px 55px rgba(15, 23, 42, 0.95);
}

.admin-main {
    min-width: 0;
}

.admin-main.full {
    grid-column: 1 / -1;
}

.admin-album-list {
    list-style: none;
    padding: 0;
    margin: 0 0 0.7rem;
}

.admin-album-list li {
    margin-bottom: 0.25rem;
}

.admin-album-list li a {
    display: block;
    padding: 0.3rem 0.45rem;
    border-radius: 0.55rem;
    font-size: 0.9rem;
    color: var(--fg-muted);
}

.admin-album-list li a:hover {
    background: rgba(30, 64, 175, 0.6);
    color: var(--fg);
}

.admin-album-list li.disabled a {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Admin gallery */
.admin-gallery .gallery-item {
    cursor: default;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: rgba(15, 23, 42, 0.95);
}

.table th,
.table td {
    padding: 0.45rem 0.55rem;
    font-size: 0.82rem;
    border-bottom: 1px solid rgba(31, 41, 55, 0.9);
}

.table th {
    text-align: left;
    background: rgba(15, 23, 42, 0.98);
    color: var(--fg-muted);
    font-weight: 500;
}

.table tr:nth-child(even) td {
    background: rgba(15, 23, 42, 0.96);
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.2rem;
    font-size: 0.9rem;
}

/* Two-column layout */
.two-column {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 1rem;
}

/* Nav rows */
.nav-row {
    display: grid;
    grid-template-columns: 1.3fr 1.8fr 0.6fr;
    gap: 0.4rem;
    margin-bottom: 0.3rem;
}

/* Login page */
.page-login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 360px;
    padding: 1.2rem;
}

.login-container h1 {
    text-align: center;
    margin-bottom: 0.8rem;
}

.login-footer {
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.8rem;
}

/* Access form */
.access-form {
    max-width: 380px;
    margin: 2.5rem auto;
}

/* Responsive */
@media (max-width: 900px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }
    .admin-sidebar {
        order: 2;
    }
    .admin-main {
        order: 1;
    }
    .two-column {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .topbar-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }
    .album-cover {
        height: 130px;
    }
    .lightbox-media {
        min-width: 80vw;
    }
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}
