:root {
    --bg: #0b0b0c;
    --panel: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.12);
    --text: #ffffff;
    --muted: rgba(255, 255, 255, 0.72);
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    --radius: 18px;
    --admin-width: 1360px;
    --admin-narrow-width: 1100px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

img {
    display: block;
    max-width: 100%;
}

code {
    font-size: 0.95em;
}

.eyebrow {
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 12px;
    color: var(--muted);
}

.hidden,
.is-hidden {
    display: none !important;
}

.auth-wrap,
.not-found-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.not-found-card,
.auth-card,
.form-card,
.table-card {
    width: 100%;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
}

.not-found-card,
.auth-card {
    max-width: 520px;
    padding: 32px;
}

.auth-card h1,
.not-found-card h1 {
    margin: 0 0 12px;
    font-size: 32px;
}

.auth-copy,
.not-found-card p,
.muted,
small {
    color: var(--muted);
}

.admin-body {
    min-height: 100vh;
    background: linear-gradient(180deg, #0b0b0c 0%, #101215 100%);
}

.admin-shell {
    width: min(calc(100% - 56px), var(--admin-width));
    margin: 0 auto;
}

.admin-shell-narrow {
    max-width: var(--admin-narrow-width);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 32px 0 18px;
}

.admin-header h1 {
    margin: 0;
    font-size: clamp(28px, 3vw, 40px);
    font-weight: 400;
}

.header-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-wrap {
    padding: 0 0 44px;
}

.admin-shell > .table-card,
.admin-shell > .form-card,
.admin-shell > .settings-grid,
.admin-shell > .settings-panel {
    width: 100%;
}

.form-card,
.table-card,
.settings-panel,
.admin-card {
    padding: 24px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.field.full,
.checkbox-row.full,
.form-actions,
.section-title,
.image-manager,
.settings-grid,
.admin-list {
    grid-column: 1 / -1;
}

.field label,
.auth-card label,
.mini-label {
    display: block;
    margin: 0 0 8px;
    font-weight: 500;
}

.mini-label {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="file"],
textarea,
select {
    width: 100%;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    border-radius: 12px;
    padding: 14px 16px;
    outline: none;
}

input[type="file"] {
    padding: 12px;
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(255, 255, 255, 0.35);
}

textarea {
    resize: vertical;
    min-height: 150px;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label input {
    width: auto;
    margin: 0;
}

.alert {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.alert.error {
    background: rgba(255, 84, 84, 0.12);
    border-color: rgba(255, 84, 84, 0.26);
}

.alert.success {
    background: rgba(46, 212, 122, 0.12);
    border-color: rgba(46, 212, 122, 0.26);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.image-manager,
.admin-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.compact-gallery {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
}

.image-card,
.settings-panel,
.admin-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow: hidden;
}

.thumb {
    width: 100%;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.08);
}

.compact-thumb {
    aspect-ratio: 4 / 3;
}

.image-card-body {
    padding: 14px;
}

.compact-image-card-body {
    padding: 12px;
}

.audio-preview {
    margin-top: 10px;
    font-size: 12px;
    color: var(--muted);
    word-break: break-word;
}

.section-title {
    margin: 12px 0 -4px;
    font-size: 18px;
    font-weight: 500;
}

.table-card {
    overflow: hidden;
}

.table-card table {
    width: 100%;
    border-collapse: collapse;
}

.table-card th,
.table-card td {
    padding: 18px 18px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    vertical-align: middle;
}

.table-card th {
    padding-top: 14px;
    padding-bottom: 14px;
    line-height: 1.2;
}

.table-card tbody tr:last-child td {
    border-bottom: 0;
}

.table-card th {
    color: var(--muted);
    font-weight: 500;
}

.property-cell {
    display: flex;
    gap: 14px;
    align-items: center;
    min-width: 0;
}

.table-thumb-wrap {
    flex: 0 0 auto;
}

.table-thumb {
    width: 86px;
    height: 56px;
    border-radius: 10px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.08);
}

.table-thumb-placeholder {
    border: 1px dashed rgba(255, 255, 255, 0.14);
}

.status {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.status.active {
    background: rgba(46, 212, 122, 0.12);
    border-color: rgba(46, 212, 122, 0.26);
}

.status.inactive {
    background: rgba(255, 255, 255, 0.06);
}

.table-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: center;
    align-items: flex-start;
}

.table-actions a {
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.1;
}

.table-row {
    min-height: 118px;
}

.cell-actions {
    width: 1%;
    white-space: nowrap;
    vertical-align: middle;
}

.cell-status {
    white-space: nowrap;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.settings-panel h2,
.admin-card h3 {
    margin: 0 0 12px;
    font-weight: 500;
}

.inline-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.auth-card button {
    width: 100%;
    margin-top: 20px;
}

.block-label {
    margin-top: 16px;
    display: block;
}

.full-span {
    grid-column: 1 / -1;
}

.btn,
.tour-start-btn,
.control-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    padding: 14px 22px;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    backdrop-filter: blur(14px);
}

.btn:hover,
.tour-start-btn:hover,
.control-btn:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.34);
}

.btn.primary {
    background: #ffffff;
    color: #101112;
    border-color: #ffffff;
}

.btn.primary:hover {
    background: rgba(255, 255, 255, 0.92);
}

.btn.danger {
    background: rgba(255, 88, 88, 0.15);
    border-color: rgba(255, 88, 88, 0.35);
}

.slideshow-body {
    overflow: hidden;
}

.slideshow {
    position: relative;
    width: 100vw;
    height: 100vh;
    background: #000;
}

.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1.4s ease;
    pointer-events: none;
}

.slide.active {
    opacity: 1;
    pointer-events: auto;
}

.slide-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.02);
}

.kenburns {
    animation: kenburns 9s ease-in-out infinite alternate;
}

@keyframes kenburns {
    from {
        transform: scale(1.02) translate3d(0, 0, 0);
    }
    to {
        transform: scale(1.12) translate3d(1.5%, -1.5%, 0);
    }
}

.intro-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
    background: rgba(0, 0, 0, 0.58);
    z-index: 3;
    transition: opacity 0.9s ease, background 0.9s ease;
}

.intro-overlay.is-fading {
    opacity: 0;
    background: rgba(0, 0, 0, 0);
}

.intro-content {
    max-width: 1100px;
    display: grid;
    gap: 28px;
    justify-items: center;
    animation: introText 1s ease both;
}

@keyframes introText {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.intro-text h1 {
    margin: 0;
    font-size: clamp(34px, 5vw, 74px);
    line-height: 1.05;
    font-weight: 300;
    letter-spacing: 0.01em;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.intro-location,
.intro-stats {
    margin: 12px 0 0;
    text-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.intro-location {
    font-size: clamp(18px, 2vw, 28px);
    font-weight: 300;
    color: rgba(255, 255, 255, 0.94);
}

.intro-stats {
    font-size: clamp(15px, 1.4vw, 20px);
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.88);
}

.tour-start-btn {
    min-width: 190px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tour-start-icon {
    font-size: 14px;
}

.slideshow-brand,
.slideshow-copyright {
    position: absolute;
    z-index: 9;
    color: rgba(255, 255, 255, 0.86);
    transition: opacity 0.2s ease;
}

.slideshow-brand:hover,
.slideshow-copyright:hover {
    opacity: 0.85;
}

.slideshow-brand {
    top: calc(env(safe-area-inset-top, 0px) + 24px);
    left: calc(env(safe-area-inset-left, 0px) + 24px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.slideshow-brand img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: 0.82;
}

.slideshow-brand span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(0, 0, 0, 0.24);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.08em;
}

.slideshow-controls {
    position: absolute;
    top: calc(env(safe-area-inset-top, 0px) + 24px);
    right: calc(env(safe-area-inset-right, 0px) + 24px);
    z-index: 8;
    display: flex;
    gap: 12px;
}

.control-btn {
    width: 54px;
    height: 54px;
    padding: 0;
    background: rgba(0, 0, 0, 0.34);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
}

.icon-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.icon-btn .icon-play,
.icon-btn .icon-pause,
.icon-btn .icon-volume-on,
.icon-btn .icon-volume-off {
    display: none;
}

.icon-btn[data-toggle-play]:not(.is-playing) .icon-play,
.icon-btn[data-toggle-play].is-playing .icon-pause,
.icon-btn[data-toggle-audio]:not(.is-muted) .icon-volume-on,
.icon-btn[data-toggle-audio].is-muted .icon-volume-off {
    display: inline-flex;
}

.slideshow.is-paused .slide.active .kenburns {
    animation-play-state: paused;
}


.slideshow-footer {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 48px;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    padding: 16px 22px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    box-shadow: var(--shadow);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.slideshow-footer.hidden {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

.footer-left,
.footer-right {
    font-size: clamp(13px, 1.2vw, 18px);
    line-height: 1.4;
}

.footer-left {
    display: grid;
    gap: 3px;
}

.footer-left strong {
    font-weight: 500;
}

.footer-left span {
    color: rgba(255, 255, 255, 0.84);
    font-size: 0.95em;
}

.footer-right {
    color: rgba(255, 255, 255, 0.88);
    text-align: right;
    letter-spacing: 0.04em;
}

.slideshow-copyright {
    left: calc(env(safe-area-inset-left, 0px) + 24px);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
    font-size: 10px;
    letter-spacing: 0.04em;
}

@media (max-width: 1100px) {
    .table-card {
        overflow-x: auto;
    }
}

@media (max-width: 900px) {
    .form-grid,
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .slideshow-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-right {
        text-align: left;
    }
}

@media (max-width: 720px) {
    .admin-shell {
        width: min(calc(100% - 24px), var(--admin-width));
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .intro-overlay {
        padding: 26px;
    }

    .slideshow-brand {
        top: calc(env(safe-area-inset-top, 0px) + 16px);
        left: calc(env(safe-area-inset-left, 0px) + 16px);
    }

    .slideshow-controls {
        top: calc(env(safe-area-inset-top, 0px) + 16px);
        right: calc(env(safe-area-inset-right, 0px) + 16px);
        bottom: auto;
        gap: 10px;
    }

    .control-btn {
        width: 48px;
        height: 48px;
    }

    .slideshow-footer {
        left: 16px;
        right: 16px;
        bottom: 34px;
        padding: 14px 16px;
    }

    .slideshow-copyright {
        left: calc(env(safe-area-inset-left, 0px) + 16px);
        bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
        max-width: calc(100vw - 32px);
    }
}

