#tab-panoramas {
    color: var(--text);
}

.panorama-page-header,
.panorama-library-header,
.panorama-player-header,
.panorama-player-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.panorama-page-header {
    padding: clamp(22px, 4vw, 42px);
    color: white;
    border-radius: 24px;
    background:
        radial-gradient(circle at 15% 15%, rgba(255, 153, 204, 0.42), transparent 38%),
        radial-gradient(circle at 85% 25%, rgba(96, 165, 250, 0.35), transparent 36%),
        linear-gradient(135deg, rgba(45, 18, 55, 0.96), rgba(16, 37, 67, 0.94));
    box-shadow: 0 20px 50px rgba(16, 24, 40, 0.24);
    overflow: hidden;
}

.panorama-page-header h2 {
    margin-top: 4px;
    font-size: clamp(30px, 5vw, 54px);
    line-height: 1;
}

.panorama-page-header p:last-child {
    max-width: 650px;
    margin-top: 12px;
    color: rgba(255, 255, 255, 0.76);
    line-height: 1.6;
}

.panorama-eyebrow {
    color: #ff9acb;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.18em;
}

.panorama-format-badge,
.panorama-count {
    flex-shrink: 0;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 12px;
    font-weight: 700;
    backdrop-filter: blur(8px);
}

.panorama-layout {
    display: grid;
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    gap: 18px;
    margin-top: 18px;
}

.panorama-upload-card,
.panorama-library {
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 16px 40px rgba(39, 18, 46, 0.16);
    backdrop-filter: blur(18px);
}

.panorama-upload-card {
    align-self: start;
    padding: 22px;
}

.panorama-upload-card h3,
.panorama-library h3 {
    margin-bottom: 18px;
    color: #302438;
}

.panorama-upload-card label {
    display: block;
    margin-bottom: 14px;
    color: #5f5266;
    font-size: 13px;
    font-weight: 700;
}

.panorama-upload-card input[type="text"],
.panorama-upload-card input[type="date"],
.panorama-upload-card textarea {
    width: 100%;
    margin-top: 6px;
    padding: 11px 12px;
    border: 1px solid #dfd6e3;
    border-radius: 12px;
    background: white;
    color: #302438;
    font: inherit;
    font-weight: 500;
}

.panorama-upload-card input:focus,
.panorama-upload-card textarea:focus {
    border-color: var(--pink);
    outline: 3px solid rgba(255, 105, 180, 0.13);
}

.panorama-form-grid {
    display: grid;
    grid-template-columns: 1fr 130px;
    gap: 10px;
}

.panorama-file-picker {
    display: flex !important;
    align-items: center;
    gap: 12px;
    min-height: 92px;
    padding: 14px;
    border: 1px dashed #cdbdce;
    border-radius: 15px;
    background: #faf7fb;
    cursor: pointer;
}

.panorama-file-picker:hover {
    border-color: var(--pink);
    background: #fff4f9;
}

.panorama-file-picker input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.panorama-file-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff70b8, #7469ff);
    color: white;
    font-size: 13px;
    font-weight: 900;
}

.panorama-file-picker strong,
.panorama-file-picker small {
    display: block;
}

.panorama-file-picker small {
    margin-top: 4px;
    color: #8d8192;
    font-weight: 500;
    line-height: 1.35;
}

.panorama-primary-btn,
.panorama-secondary-btn,
.panorama-card-action {
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 800;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.panorama-primary-btn {
    width: 100%;
    padding: 13px 16px;
    background: linear-gradient(135deg, #ff5fa8, #7c6cff);
    color: white;
    box-shadow: 0 9px 22px rgba(184, 69, 151, 0.25);
}

.panorama-primary-btn:hover,
.panorama-secondary-btn:hover,
.panorama-card-action:hover {
    transform: translateY(-1px);
}

.panorama-primary-btn:disabled {
    cursor: wait;
    opacity: 0.65;
    transform: none;
}

.panorama-upload-status {
    min-height: 20px;
    margin-top: 10px;
    color: #75677c;
    font-size: 12px;
    text-align: center;
}

.panorama-upload-progress {
    height: 8px;
    margin-top: 14px;
    overflow: hidden;
    border-radius: 999px;
    background: #eadfea;
}

.panorama-upload-progress > div {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ff5fa8, #7c6cff);
    transition: width 0.2s ease;
}

.panorama-upload-status.error {
    color: #c62828;
}

.panorama-library {
    min-width: 0;
    padding: 22px;
}

.panorama-library-header {
    margin-bottom: 16px;
}

.panorama-library-header h3 {
    margin: 3px 0 0;
}

.panorama-count {
    border-color: #eadfea;
    background: #f7f1f8;
    color: #6d5e74;
}

.panorama-video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
}

.panorama-video-card {
    overflow: hidden;
    border: 1px solid #e7dfe9;
    border-radius: 17px;
    background: white;
    box-shadow: 0 7px 18px rgba(43, 26, 50, 0.08);
}

.panorama-card-visual {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 145px;
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 116, 182, 0.75), transparent 35%),
        radial-gradient(circle at 75% 70%, rgba(82, 112, 255, 0.72), transparent 40%),
        linear-gradient(145deg, #39233f, #182e4b);
    color: white;
}

.panorama-card-orbit {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 50%;
    font-size: 19px;
    font-weight: 900;
    box-shadow: 0 0 0 12px rgba(255, 255, 255, 0.07);
}

.panorama-card-body {
    padding: 15px;
}

.panorama-card-body h4 {
    overflow: hidden;
    color: #34283a;
    font-size: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.panorama-card-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 7px;
    color: #8a7e90;
    font-size: 12px;
}

.panorama-card-notes {
    min-height: 38px;
    margin-top: 10px;
    color: #6d6272;
    font-size: 13px;
    line-height: 1.45;
}

.panorama-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 7px;
    margin-top: 13px;
}

.panorama-card-action {
    padding: 9px 10px;
    background: #f3edf5;
    color: #5f5266;
    font-size: 12px;
    text-align: center;
}

.panorama-card-action.primary {
    background: #34283a;
    color: white;
}

.panorama-card-action.danger {
    color: #b42318;
}

.panorama-empty {
    grid-column: 1 / -1;
    padding: 55px 20px;
    border: 1px dashed #d7cbd9;
    border-radius: 16px;
    color: #8a7e90;
    text-align: center;
}

.panorama-player-overlay {
    position: fixed;
    inset: 0;
    z-index: 1800;
    display: grid;
    place-items: center;
    padding: 12px;
    background: rgba(13, 9, 18, 0.84);
    backdrop-filter: blur(12px);
}

.panorama-player-dialog {
    display: flex;
    flex-direction: column;
    width: min(1500px, 98vw);
    height: min(96vh, 1080px);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 22px;
    background: #17121b;
    color: white;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
}

.panorama-player-header,
.panorama-player-footer {
    flex-shrink: 0;
    padding: 15px 18px;
}

.panorama-player-header h3 {
    margin-top: 3px;
}

.panorama-close-btn {
    border: 0;
    background: transparent;
    color: white;
    font-size: 32px;
    cursor: pointer;
}

.panorama-scene-wrap {
    position: relative;
    flex: 1;
    min-height: 0;
    background: black;
}

#panorama-scene {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

#panorama-scene .a-canvas {
    cursor: grab;
}

#panorama-scene .a-canvas:active {
    cursor: grabbing;
}

.panorama-drag-hint {
    position: absolute;
    top: 16px;
    bottom: auto;
    left: 50%;
    z-index: 2;
    transform: translateX(-50%);
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    color: rgba(255, 255, 255, 0.84);
    font-size: 12px;
    pointer-events: none;
}

.panorama-video-source {
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
    width: 1px;
    height: 1px;
    opacity: 0.01;
    pointer-events: none;
}

.panorama-player-loading {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background:
        radial-gradient(circle at center, rgba(64, 42, 70, 0.45), transparent 45%),
        #050406;
    color: rgba(255, 255, 255, 0.86);
    font-size: 14px;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.panorama-player-loading.hidden {
    visibility: hidden;
    opacity: 0;
}

.panorama-player-loading.error {
    color: #ffb4b4;
    padding: 28px;
    text-align: center;
}

.panorama-loading-spinner {
    width: 34px;
    height: 34px;
    border: 4px solid rgba(255, 255, 255, 0.18);
    border-top-color: #ff79ba;
    border-radius: 50%;
    animation: panoramaSpin 0.8s linear infinite;
}

.panorama-player-loading.error .panorama-loading-spinner {
    display: none;
}

.panorama-codec-error-title {
    color: #fff;
    font-size: clamp(20px, 3vw, 32px);
}

.panorama-codec-error-text {
    max-width: 620px;
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

.panorama-codec-error-code {
    color: #ff94c8;
    font-family: monospace;
}

.panorama-codec-badge {
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(86, 176, 120, 0.14);
    color: #368254;
    font-size: 10px;
    font-weight: 700;
}

.panorama-codec-badge.unsupported {
    background: rgba(211, 72, 92, 0.12);
    color: #b52d47;
}

.panorama-card-codec-warning {
    margin: 0;
    color: #a63c50;
    font-size: 11px;
    line-height: 1.45;
}

.panorama-card-action.codec-disabled {
    border-color: rgba(181, 45, 71, 0.2);
    background: rgba(181, 45, 71, 0.08);
    color: #a63c50;
    cursor: not-allowed;
    opacity: 1;
}

@keyframes panoramaSpin {
    to { transform: rotate(360deg); }
}

.panorama-video-controls {
    position: absolute;
    right: 16px;
    bottom: 16px;
    left: 16px;
    z-index: 4;
    display: grid;
    grid-template-columns: auto minmax(80px, 1fr) auto auto;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    background: rgba(10, 8, 12, 0.72);
    backdrop-filter: blur(12px);
}

.panorama-volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.panorama-control-btn {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: white;
    cursor: pointer;
}

#panorama-seek {
    width: 100%;
    accent-color: #ff69b4;
    cursor: pointer;
}

#panorama-volume {
    width: 96px;
    accent-color: #ff69b4;
    cursor: pointer;
}

#panorama-time {
    min-width: 92px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.panorama-player-footer p {
    max-width: 720px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    white-space: pre-wrap;
}

.panorama-secondary-btn {
    flex-shrink: 0;
    padding: 10px 14px;
    background: white;
    color: #2c2231;
    font-size: 12px;
}

@media (max-width: 850px) {
    .panorama-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .panorama-page-header,
    .panorama-player-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .panorama-form-grid {
        grid-template-columns: 1fr;
    }

    .panorama-player-overlay {
        padding: 0;
    }

    .panorama-player-dialog {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }

    .panorama-scene-wrap {
        min-height: 0;
    }

    .panorama-video-controls {
        right: 8px;
        bottom: 8px;
        left: 8px;
        grid-template-columns: auto minmax(60px, 1fr) auto;
        gap: 8px;
    }

    #panorama-volume {
        width: 72px;
    }

    #panorama-time {
        display: none;
    }
}
