* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-tertiary: #374151;
    --border-color: #374151;
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --accent: #ef4444;
    --accent-hover: #dc2626;
    --surface: rgba(17, 24, 39, 0.82);
    --surface-strong: rgba(17, 24, 39, 0.95);
    --shadow: 0 20px 35px -20px rgba(0, 0, 0, 0.55);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-primary);
    background: linear-gradient(135deg, #111827 0%, #030712 48%, #111827 100%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

.bg-overlay {
    position: fixed;
    inset: 0;
    background: rgba(239, 68, 68, 0.045);
    backdrop-filter: blur(100px);
    pointer-events: none;
    z-index: 0;
}

.bg-circle {
    position: fixed;
    border-radius: 999px;
    filter: blur(90px);
    pointer-events: none;
    z-index: 0;
    animation: pulse 5s ease-in-out infinite;
}

.bg-circle-1 {
    width: 300px;
    height: 300px;
    left: 15%;
    top: 18%;
    background: rgba(239, 68, 68, 0.12);
}

.bg-circle-2 {
    width: 360px;
    height: 360px;
    right: 10%;
    bottom: 10%;
    background: rgba(239, 68, 68, 0.08);
    animation-delay: 1s;
}

@keyframes pulse {
    0%,
    100% { opacity: 0.45; transform: scale(1); }
    50% { opacity: 0.75; transform: scale(1.08); }
}

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgb(18 22 37);
    border-bottom: 1px solid #1f2937;
    backdrop-filter: blur(4px);
}

.header-content {
    width: 100%;
    max-width: none;
    margin: 0;
    height: 80px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo-container {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-icon-img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
}

.logo-text {
    font-size: 1.45rem;
    font-weight: 700;
    background: linear-gradient(to right, #ffffff, #d1d5db);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.button {
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-primary);
    border: none;
    background: var(--bg-secondary);
    transition: all 0.3s;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.button-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.button-admin {
    background-color: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #60a5fa;
}

.button-admin:hover {
    background-color: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.6);
}

.button-home,
.button-logout {
    background-color: rgba(107, 114, 128, 0.2);
    border: 1px solid rgba(107, 114, 128, 0.4);
    color: #d1d5db;
}

.button-home:hover {
    background-color: rgba(107, 114, 128, 0.3);
    border-color: rgba(107, 114, 128, 0.6);
}

.button-logout {
    background-color: rgba(220, 38, 38, 0.2);
    border: 1px solid rgba(220, 38, 38, 0.4);
    color: #ef4444;
}

.button-logout:hover {
    background-color: rgba(220, 38, 38, 0.3);
    border-color: rgba(220, 38, 38, 0.6);
}

.icon-nav-button {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.page-main {
    position: relative;
    z-index: 1;
    max-width: 1220px;
    margin: 0 auto;
    padding: 32px 24px 48px;
    display: grid;
    gap: 20px;
}

body[data-page="gallery"] .page-main,
body[data-page="admin"] .page-main {
    max-width: none;
    width: 100%;
    padding-left: 28px;
    padding-right: 28px;
    gap: 24px;
}

body[data-page="gallery"] .panel,
body[data-page="admin"] .panel,
body[data-page="gallery"] .page-intro,
body[data-page="admin"] .page-intro {
    padding: 24px;
}

.page-intro {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.page-intro h2 {
    font-size: 1.9rem;
    margin-bottom: 8px;
}

.page-intro p {
    color: var(--text-secondary);
    max-width: 70ch;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fca5a5;
    font-weight: 700;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.controls-panel {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

body[data-page="gallery"] .select-input,
body[data-page="admin"] .select-input {
    width: auto;
    min-width: 190px;
}

.search-wrap {
    min-width: 250px;
    flex: 1;
    position: relative;
}

.search-wrap i {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.search-wrap input,
.select-input,
.text-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.92rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.search-wrap input {
    padding-left: 36px;
}

.search-wrap input:focus,
.select-input:focus,
.text-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.gallery-grid,
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.media-card {
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    background: rgba(31, 41, 55, 0.9);
}

.media-thumb {
    height: 210px;
    background: #030712;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.media-thumb img,
.media-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-play {
    position: absolute;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.65);
    display: grid;
    place-items: center;
    color: #fff;
    pointer-events: none;
}

.media-thumb::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 90px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0));
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.media-thumb:hover::after,
.media-thumb:focus-within::after {
    opacity: 1;
}

.media-info {
    padding: 14px;
    display: grid;
    gap: 10px;
}

.media-name {
    font-size: 0.88rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-meta {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 0.77rem;
    gap: 8px;
}

.media-owner {
    margin-top: 2px;
    color: #fca5a5;
    font-size: 0.78rem;
    font-weight: 600;
}

.media-actions {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.media-thumb:hover .media-actions,
.media-thumb:focus-within .media-actions {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.media-actions .button {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    border-width: 1px;
    border-style: solid;
    backdrop-filter: blur(6px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.media-actions .button-home {
    background-color: rgba(17, 24, 39, 0.88);
    border-color: rgba(148, 163, 184, 0.55);
    color: #e5e7eb;
}

.media-actions .button-home:hover {
    background-color: rgba(30, 41, 59, 0.96);
    border-color: rgba(203, 213, 225, 0.8);
    color: #ffffff;
}

.media-actions .button-logout {
    background-color: rgba(127, 29, 29, 0.9);
    border-color: rgba(248, 113, 113, 0.75);
    color: #fee2e2;
}

.media-actions .button-logout:hover {
    background-color: rgba(153, 27, 27, 0.98);
    border-color: rgba(252, 165, 165, 0.95);
    color: #ffffff;
}

@media (hover: none) {
    .media-thumb::after {
        opacity: 1;
    }

    .media-actions {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
}

.pagination-controls {
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.pagination-controls p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.empty-state {
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    padding: 26px;
    text-align: center;
    color: var(--text-secondary);
}

.reveal {
    animation: reveal 0.38s ease;
}

@keyframes reveal {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.admin-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

.admin-topbar .text-input,
.admin-topbar .select-input {
    width: auto;
    min-width: 210px;
}

.stats-grid {
    margin-top: 18px;
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.stat-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(31, 41, 55, 0.8);
    padding: 14px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.guide-section {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(31, 41, 55, 0.75);
}

.guide-section.hidden {
    display: none;
}

.upload-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
}

.modal.active {
    display: block;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    z-index: 1;
    max-width: 500px;
    margin: 7vh auto;
    background: #111827;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
}

.modal-preview {
    max-width: 860px;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
}

#modalMediaContainer {
    max-height: 75vh;
    overflow: auto;
    margin-top: 20px;
    border-radius: 10px;
}

#modalMediaContainer img,
#modalMediaContainer video {
    width: 100%;
    max-height: 72vh;
    object-fit: contain;
    background: #000;
}

.modal-copy {
    margin-top: 10px;
    width: 100%;
}

.profile-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 100%;
    z-index: 1000;
    transition: right 0.3s ease;
}

.profile-sidebar.active {
    right: 0;
}

.profile-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.profile-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 550px;
    height: 100vh;
    background: var(--bg-primary);
    border-left: 1px solid var(--border-color);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.profile-close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.2s;
    z-index: 10;
}

.profile-close-btn:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
}

.profile-header {
    padding: 2.5rem 2rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), transparent);
}

.profile-avatar-large {
    width: 5rem;
    height: 5rem;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
}

.profile-username {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.profile-email {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.profile-nav {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.profile-nav-item {
    width: 100%;
    padding: 1rem 1.25rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 0.5rem;
}

.profile-nav-item:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.profile-nav-item.active {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.profile-nav-item i {
    width: 1.25rem;
}

.profile-content {
    flex: 1;
    padding: 2rem;
}

.profile-section {
    display: none;
}

.profile-section.active {
    display: block;
}

.profile-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #ef4444;
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.profile-stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 0.75rem;
    padding: 1.25rem;
}

.profile-stat-icon {
    width: 3rem;
    height: 3rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ef4444;
    font-size: 1.5rem;
}

.profile-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.profile-stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.profile-card {
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 0.75rem;
    padding: 1.25rem;
}

.profile-card h4 {
    margin-bottom: 0.35rem;
    font-size: 1.1rem;
}

.profile-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.55;
}

.profile-actions {
    margin-top: 0;
    margin-bottom: 0.75rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.profile-toggle {
    margin-top: 0.6rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
}

.profile-toggle input {
    width: 3rem;
    height: 1.5rem;
    appearance: none;
    background: var(--bg-tertiary);
    border-radius: 1rem;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
}

.profile-toggle input:checked {
    background: #ef4444;
}

.profile-toggle input::before {
    content: "";
    position: absolute;
    width: 1.25rem;
    height: 1.25rem;
    background: #ffffff;
    border-radius: 50%;
    top: 0.125rem;
    left: 0.125rem;
    transition: transform 0.2s;
}

.profile-toggle input:checked::before {
    transform: translateX(1.5rem);
}

.coming-soon {
    color: var(--text-secondary);
    align-items: flex-start;
}

.confirm-actions {
    margin-top: 14px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.hidden {
    display: none;
}

.account-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.account-section {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(31, 41, 55, 0.7);
    display: grid;
    gap: 12px;
}

.config-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px;
    background: rgba(17, 24, 39, 0.85);
    display: grid;
    gap: 10px;
}

.config-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.config-card pre {
    white-space: pre-wrap;
    word-break: break-word;
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.85rem;
    color: #e5e7eb;
}

.config-error {
    color: #fca5a5;
}

.input-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.muted {
    color: var(--text-secondary);
}

@media (max-width: 920px) {
    .gallery-grid,
    .admin-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

@media (max-width: 760px) {
    .header-content {
        height: auto;
        padding-top: 12px;
        padding-bottom: 12px;
        flex-direction: column;
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .page-main {
        padding: 20px 14px 36px;
    }

    body[data-page="gallery"] .page-main,
    body[data-page="admin"] .page-main {
        padding-left: 14px;
        padding-right: 14px;
        gap: 16px;
    }

    body[data-page="gallery"] .panel,
    body[data-page="admin"] .panel,
    body[data-page="gallery"] .page-intro,
    body[data-page="admin"] .page-intro {
        padding: 16px;
    }

    .panel,
    .page-intro {
        padding: 14px;
    }

    .media-thumb {
        height: 170px;
    }

    .admin-topbar .text-input,
    .admin-topbar .select-input {
        width: 100%;
    }
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-tertiary: #374151;
    --border-color: #374151;
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --accent: #ef4444;
    --accent-hover: #dc2626;
    --surface: rgba(17, 24, 39, 0.82);
    --surface-strong: rgba(17, 24, 39, 0.95);
    --shadow: 0 20px 35px -20px rgba(0, 0, 0, 0.55);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-primary);
    background: linear-gradient(135deg, #111827 0%, #030712 48%, #111827 100%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

.bg-overlay {
    position: fixed;
    inset: 0;
    background: rgba(239, 68, 68, 0.045);
    backdrop-filter: blur(100px);
    pointer-events: none;
    z-index: 0;
}

.bg-circle {
    position: fixed;
    border-radius: 999px;
    filter: blur(90px);
    pointer-events: none;
    z-index: 0;
    animation: pulse 5s ease-in-out infinite;
}

.bg-circle-1 {
    width: 300px;
    height: 300px;
    left: 15%;
    top: 18%;
    background: rgba(239, 68, 68, 0.12);
}

.bg-circle-2 {
    width: 360px;
    height: 360px;
    right: 10%;
    bottom: 10%;
    background: rgba(239, 68, 68, 0.08);
    animation-delay: 1s;
}

@keyframes pulse {
    0%,
    100% { opacity: 0.45; transform: scale(1); }
    50% { opacity: 0.75; transform: scale(1.08); }
}

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgb(18 22 37);
    border-bottom: 1px solid #1f2937;
    backdrop-filter: blur(4px);
}

.header-content {
    width: 100%;
    max-width: none;
    margin: 0;
    height: 80px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo-container {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-icon-img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
}

.logo-text {
    font-size: 1.45rem;
    font-weight: 700;
    background: linear-gradient(to right, #ffffff, #d1d5db);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.button {
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-primary);
    border: none;
    background: var(--bg-secondary);
    transition: all 0.3s;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.button-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.button-admin {
    background-color: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #60a5fa;
}

.button-admin:hover {
    background-color: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.6);
}

.button-home,
.button-logout {
    background-color: rgba(107, 114, 128, 0.2);
    border: 1px solid rgba(107, 114, 128, 0.4);
    color: #d1d5db;
}

.button-home:hover {
    background-color: rgba(107, 114, 128, 0.3);
    border-color: rgba(107, 114, 128, 0.6);
}

.button-logout {
    background-color: rgba(220, 38, 38, 0.2);
    border: 1px solid rgba(220, 38, 38, 0.4);
    color: #ef4444;
}

.button-logout:hover {
    background-color: rgba(220, 38, 38, 0.3);
    border-color: rgba(220, 38, 38, 0.6);
}

.icon-nav-button {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.page-main {
    position: relative;
    z-index: 1;
    max-width: 1220px;
    margin: 0 auto;
    padding: 32px 24px 48px;
    display: grid;
    gap: 20px;
}

body[data-page="gallery"] .page-main,
body[data-page="admin"] .page-main {
    max-width: none;
    width: 100%;
    padding-left: 28px;
    padding-right: 28px;
    gap: 24px;
}

body[data-page="gallery"] .panel,
body[data-page="admin"] .panel,
body[data-page="gallery"] .page-intro,
body[data-page="admin"] .page-intro {
    padding: 24px;
}

.page-intro {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.page-intro h2 {
    font-size: 1.9rem;
    margin-bottom: 8px;
}

.page-intro p {
    color: var(--text-secondary);
    max-width: 70ch;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fca5a5;
    font-weight: 700;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.controls-panel {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

body[data-page="gallery"] .select-input,
body[data-page="admin"] .select-input {
    width: auto;
    min-width: 190px;
}

.search-wrap {
    min-width: 250px;
    flex: 1;
    position: relative;
}

.search-wrap i {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.search-wrap input,
.select-input,
.text-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.92rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.search-wrap input {
    padding-left: 36px;
}

.search-wrap input:focus,
.select-input:focus,
.text-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.gallery-grid,
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.media-card {
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    background: rgba(31, 41, 55, 0.9);
}

.media-thumb {
    height: 210px;
    background: #030712;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.media-thumb img,
.media-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-play {
    position: absolute;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.65);
    display: grid;
    place-items: center;
    color: #fff;
    pointer-events: none;
}

.media-thumb::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 90px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0));
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.media-thumb:hover::after,
.media-thumb:focus-within::after {
    opacity: 1;
}

.media-info {
    padding: 14px;
    display: grid;
    gap: 10px;
}

.media-name {
    font-size: 0.88rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-meta {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 0.77rem;
    gap: 8px;
}

.media-owner {
    margin-top: 2px;
    color: #fca5a5;
    font-size: 0.78rem;
    font-weight: 600;
}

.media-actions {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.media-thumb:hover .media-actions,
.media-thumb:focus-within .media-actions {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.media-actions .button {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    border-width: 1px;
    border-style: solid;
    backdrop-filter: blur(6px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.media-actions .button-home {
    background-color: rgba(17, 24, 39, 0.88);
    border-color: rgba(148, 163, 184, 0.55);
    color: #e5e7eb;
}

.media-actions .button-home:hover {
    background-color: rgba(30, 41, 59, 0.96);
    border-color: rgba(203, 213, 225, 0.8);
    color: #ffffff;
}

.media-actions .button-logout {
    background-color: rgba(127, 29, 29, 0.9);
    border-color: rgba(248, 113, 113, 0.75);
    color: #fee2e2;
}

.media-actions .button-logout:hover {
    background-color: rgba(153, 27, 27, 0.98);
    border-color: rgba(252, 165, 165, 0.95);
    color: #ffffff;
}

@media (hover: none) {
    .media-thumb::after {
        opacity: 1;
    }

    .media-actions {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
}

.pagination-controls {
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.pagination-controls p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.empty-state {
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    padding: 26px;
    text-align: center;
    color: var(--text-secondary);
}

.reveal {
    animation: reveal 0.38s ease;
}

@keyframes reveal {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.home-hero {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 20px;
}

.hero-card {
    background: linear-gradient(145deg, rgba(239, 68, 68, 0.14), rgba(17, 24, 39, 0.75));
    border: 1px solid rgba(239, 68, 68, 0.33);
    border-radius: 16px;
    padding: 28px;
    box-shadow: var(--shadow);
}

.hero-title {
    font-size: 2.25rem;
    line-height: 1.1;
    margin-bottom: 10px;
}

.hero-copy {
    color: #d1d5db;
    margin-bottom: 18px;
    max-width: 55ch;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.metrics {
    display: grid;
    gap: 12px;
}

.metric-card {
    background: rgba(17, 24, 39, 0.86);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px;
}

.metric-value {
    font-size: 1.65rem;
    font-weight: 700;
    color: #fff;
}

.metric-label {
    color: var(--text-secondary);
    font-size: 0.84rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.feature-card {
    border: 1px solid var(--border-color);
    background: rgba(17, 24, 39, 0.83);
    border-radius: 14px;
    padding: 16px;
}

.feature-card h3 {
    font-size: 1rem;
    margin-bottom: 8px;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.admin-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

.admin-topbar .text-input,
.admin-topbar .select-input {
    width: auto;
    min-width: 210px;
}

.stats-grid {
    margin-top: 18px;
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.stat-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(31, 41, 55, 0.8);
    padding: 14px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.guide-section {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(31, 41, 55, 0.75);
}

.guide-section.hidden {
    display: none;
}

.upload-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.user-section {
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    background: rgba(31, 41, 55, 0.78);
}

.user-header {
    width: 100%;
    border: 0;
    padding: 14px;
    color: var(--text-primary);
    background: rgba(17, 24, 39, 0.9);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-weight: 600;
    text-align: left;
}

.user-summary {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
}

.user-header i {
    transition: transform 0.2s ease;
}

.user-section.expanded .user-header i {
    transform: rotate(180deg);
}

.user-content {
    display: none;
    padding: 14px;
}

.user-section.expanded .user-content {
    display: block;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
}

.modal.active {
    display: block;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    z-index: 1;
    max-width: 500px;
    margin: 7vh auto;
    background: #111827;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
}

.modal-preview {
    max-width: 860px;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
}

#modalMediaContainer {
    max-height: 75vh;
    overflow: auto;
    margin-top: 20px;
    border-radius: 10px;
}

#modalMediaContainer img,
#modalMediaContainer video {
    width: 100%;
    max-height: 72vh;
    object-fit: contain;
    background: #000;
}

.modal-copy {
    margin-top: 10px;
    width: 100%;
}

.profile-modal-content {
    max-width: 680px;
}

.profile-modal-content h3 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-block {
    margin-top: 14px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(31, 41, 55, 0.6);
}

.profile-block h4 {
    margin-bottom: 6px;
}

.profile-block p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.profile-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.profile-toggle {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.86rem;
}

.profile-toggle input {
    accent-color: var(--accent);
}

.coming-soon {
    color: #fca5a5;
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 100%;
    z-index: 1000;
    transition: right 0.3s ease;
}

.profile-sidebar.active {
    right: 0;
}

.profile-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.profile-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 550px;
    height: 100vh;
    background: var(--bg-primary);
    border-left: 1px solid var(--border-color);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.profile-close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.2s;
    z-index: 10;
}

.profile-close-btn:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
}

.profile-header {
    padding: 2.5rem 2rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), transparent);
}

.profile-avatar-large {
    width: 5rem;
    height: 5rem;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
}

.profile-username {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.profile-email {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.profile-nav {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.profile-nav-item {
    width: 100%;
    padding: 1rem 1.25rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 0.5rem;
}

.profile-nav-item:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.profile-nav-item.active {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.profile-nav-item i {
    width: 1.25rem;
}

.profile-content {
    flex: 1;
    padding: 2rem;
}

.profile-section {
    display: none;
}

.profile-section.active {
    display: block;
}

.profile-sidebar .section-title,
.profile-sidebar .profile-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #ef4444;
}

.profile-sidebar .stats-grid,
.profile-sidebar .profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.profile-sidebar .stat-card,
.profile-sidebar .profile-stat-card,
.profile-sidebar .profile-card {
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 0.75rem;
    padding: 1.25rem;
}

.profile-sidebar .stat-card,
.profile-sidebar .profile-stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.profile-sidebar .stat-icon,
.profile-sidebar .profile-stat-icon {
    width: 3rem;
    height: 3rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ef4444;
    font-size: 1.5rem;
}

.profile-sidebar .stat-value,
.profile-sidebar .profile-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.profile-sidebar .stat-label,
.profile-sidebar .profile-stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.profile-sidebar .profile-card h4 {
    margin-bottom: 0.35rem;
    font-size: 1.1rem;
}

.profile-sidebar .profile-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.55;
}

.profile-sidebar .profile-actions {
    margin-top: 0;
    margin-bottom: 0.75rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.profile-sidebar .profile-toggle {
    margin-top: 0.6rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
}

.profile-sidebar .profile-toggle input {
    width: 3rem;
    height: 1.5rem;
    appearance: none;
    background: var(--bg-tertiary);
    border-radius: 1rem;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
}

.profile-sidebar .profile-toggle input:checked {
    background: #ef4444;
}

.profile-sidebar .profile-toggle input::before {
    content: "";
    position: absolute;
    width: 1.25rem;
    height: 1.25rem;
    background: #ffffff;
    border-radius: 50%;
    top: 0.125rem;
    left: 0.125rem;
    transition: transform 0.2s;
}

.profile-sidebar .profile-toggle input:checked::before {
    transform: translateX(1.5rem);
}

.profile-sidebar .coming-soon {
    color: var(--text-secondary);
    align-items: flex-start;
}

.confirm-actions {
    margin-top: 14px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

@media (max-width: 920px) {
    .home-hero {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .header-content {
        height: auto;
        padding-top: 12px;
        padding-bottom: 12px;
        flex-direction: column;
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .page-main {
        padding: 20px 14px 36px;
    }

    body[data-page="gallery"] .page-main,
    body[data-page="admin"] .page-main {
        padding-left: 14px;
        padding-right: 14px;
        gap: 16px;
    }

    body[data-page="gallery"] .panel,
    body[data-page="admin"] .panel,
    body[data-page="gallery"] .page-intro,
    body[data-page="admin"] .page-intro {
        padding: 16px;
    }

    .panel,
    .page-intro,
    .hero-card {
        padding: 14px;
    }

    .media-thumb {
        height: 170px;
    }

    .gallery-grid,
    .admin-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .admin-topbar .text-input,
    .admin-topbar .select-input {
        width: 100%;
    }
}

.hidden {
    display: none;
}

.account-topbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
}

.account-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    display: grid;
    gap: 12px;
}

.config-card {
    background: rgba(17, 24, 39, 0.85);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
}

.config-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.config-card pre {
    white-space: pre-wrap;
    word-break: break-word;
    color: #e5e7eb;
    font-size: 0.85rem;
    background: rgba(15, 23, 42, 0.8);
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.config-error {
    color: #fca5a5;
}

.input-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.muted {
    color: var(--text-secondary);
}
