body {
    background:
        radial-gradient(circle at 12% 10%, rgba(220, 38, 38, 0.12), transparent 30%),
        radial-gradient(circle at 88% 80%, rgba(15, 23, 42, 0.10), transparent 32%),
        var(--bg);
}

.upload-short-page {
    width: 100%;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(360px, 620px) 300px;
    justify-content: center;
    align-items: start;
    gap: 24px;
    padding: 24px;
}

.upload-short-device {
    width: 100%;
    min-height: calc(100dvh - 48px);
    background: var(--bg);
    border-radius: 36px;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.92);
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.12);
    padding: 18px;
}

.upload-short-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.upload-short-icon-btn {
    width: 46px;
    height: 46px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.upload-short-icon-btn ion-icon {
    font-size: 23px;
}

.upload-short-title-box {
    flex: 1;
    min-width: 0;
}

.upload-short-title-box h1 {
    margin: 0;
    color: var(--text);
    font-size: 24px;
    font-weight: 950;
    letter-spacing: -0.5px;
}

.upload-short-title-box p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 750;
}

.upload-short-progress-badge {
    min-width: 58px;
    min-height: 38px;
    border-radius: 999px;
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(220, 38, 38, 0.18);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 950;
}

.upload-short-hero {
    background: linear-gradient(135deg, #111827, var(--primary));
    border-radius: 30px;
    padding: 18px;
    color: #ffffff;
    display: flex;
    gap: 14px;
    align-items: center;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.22);
    margin-bottom: 16px;
}

.upload-short-hero-icon {
    width: 62px;
    height: 62px;
    border-radius: 23px;
    background: rgba(255, 255, 255, 0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.upload-short-hero-icon ion-icon {
    font-size: 33px;
}

.upload-short-hero h2 {
    margin: 0;
    font-size: 21px;
    font-weight: 950;
}

.upload-short-hero p {
    margin: 5px 0 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    line-height: 1.45;
    font-weight: 700;
}

.upload-short-progress-track {
    height: 8px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.24);
    overflow: hidden;
    margin-top: 12px;
}

.upload-short-progress-track span {
    width: 5%;
    height: 100%;
    display: block;
    border-radius: 99px;
    background: #ffffff;
    transition: width 0.2s ease;
}

.login-required-box {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 24px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.login-required-box ion-icon {
    color: #f97316;
    font-size: 28px;
}

.login-required-box div {
    flex: 1;
}

.login-required-box h3 {
    margin: 0;
    color: var(--text);
    font-size: 15px;
    font-weight: 950;
}

.login-required-box p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 700;
}

.login-required-box a {
    background: #f97316;
    color: #ffffff;
    border-radius: 999px;
    padding: 9px 13px;
    font-weight: 950;
    font-size: 13px;
}

.upload-short-form {
    display: grid;
    gap: 16px;
}

.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 18px;
    box-shadow: 0 14px 38px rgba(15, 23, 42, 0.06);
}

.form-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.form-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 17px;
    background: var(--primary-soft);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.form-card-icon ion-icon {
    font-size: 24px;
}

.form-card-head h3 {
    margin: 0;
    color: var(--text);
    font-size: 17px;
    font-weight: 950;
}

.form-card-head p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.form-label {
    display: block;
    color: var(--text);
    font-size: 13.5px;
    font-weight: 950;
    margin: 13px 0 8px;
}

.no-margin {
    margin: 0;
}

.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 14px 0 8px;
}

.label-row span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.form-control {
    width: 100%;
    border: 1px solid var(--border);
    outline: 0;
    background: #f8fafc;
    color: var(--text);
    border-radius: 18px;
    padding: 13px 14px;
    min-height: 50px;
    font-size: 15px;
    font-weight: 750;
}

.form-control:focus {
    background: #ffffff;
    border-color: rgba(220, 38, 38, 0.55);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.08);
}

.title-input {
    min-height: 82px;
    resize: vertical;
}

.caption-input {
    min-height: 170px;
    resize: vertical;
    line-height: 1.6;
}

.current-location-btn {
    width: 100%;
    min-height: 50px;
    border: 0;
    border-radius: 999px;
    background: #111827;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-weight: 950;
    margin-bottom: 14px;
}

.current-location-btn ion-icon {
    font-size: 20px;
}

.current-location-btn:disabled {
    opacity: 0.72;
    cursor: not-allowed;
}

#stateSelect:disabled,
#citySelect:disabled {
    opacity: 0.72;
    cursor: not-allowed;
}

.selected-location-box {
    background: rgba(220, 38, 38, 0.05);
    border: 1px solid rgba(220, 38, 38, 0.14);
    border-radius: 22px;
    padding: 14px;
    margin-top: 14px;
}

.selected-location-box div:first-child {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--primary);
}

.selected-location-box div:first-child ion-icon {
    font-size: 18px;
}

.selected-location-box strong {
    color: var(--text);
    font-size: 14px;
    font-weight: 950;
}

.selected-location-box p {
    margin: 8px 0 0;
    color: var(--text);
    font-size: 14px;
    font-weight: 850;
    line-height: 1.4;
}

.location-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.location-pills span {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 7px 10px;
    color: var(--text);
    font-size: 12px;
    font-weight: 850;
}

.media-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.media-picker-card {
    min-height: 132px;
    border: 1px solid var(--border);
    background: #f8fafc;
    border-radius: 24px;
    padding: 16px;
    display: grid;
    place-items: center;
    text-align: center;
    cursor: pointer;
}

.media-picker-card span {
    width: 52px;
    height: 52px;
    border-radius: 20px;
    background: var(--primary-soft);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.media-picker-card span ion-icon {
    font-size: 28px;
}

.media-picker-card strong {
    color: var(--text);
    font-size: 14px;
    font-weight: 950;
}

.media-picker-card small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    margin-top: 4px;
}

.selected-files-list {
    display: grid;
    gap: 9px;
    margin-top: 13px;
}

.file-row {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 9px;
}

.file-row ion-icon {
    color: var(--primary);
    font-size: 18px;
}

.file-row span {
    flex: 1;
    min-width: 0;
    color: var(--text);
    font-size: 12.5px;
    font-weight: 850;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-row button {
    border: 0;
    background: transparent;
    color: var(--primary);
    font-weight: 950;
}

.publish-btn {
    width: 100%;
    min-height: 54px;
    border: 0;
    border-radius: 999px;
    background: var(--primary);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-size: 15px;
    font-weight: 950;
    box-shadow: 0 16px 34px rgba(220, 38, 38, 0.28);
}

.publish-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.upload-short-side-panel {
    position: sticky;
    top: 24px;
}

.upload-short-side-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: 20px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.10);
}

.upload-short-side-card img {
    width: 86px;
    height: 86px;
    border-radius: 24px;
    object-fit: cover;
    border: 1px solid var(--border);
}

.upload-short-side-card h2 {
    margin: 16px 0 8px;
    color: var(--text);
    font-size: 22px;
    line-height: 1.22;
}

.upload-short-side-card p {
    margin: 0 0 16px;
    color: var(--muted);
    line-height: 1.55;
    font-size: 14px;
    font-weight: 700;
}

.side-action-link {
    width: 100%;
    min-height: 46px;
    border: 0;
    border-radius: 16px;
    background: #f8fafc;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 13px;
    margin-top: 9px;
    font-size: 14px;
    font-weight: 900;
}

.side-action-link:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.upload-progress-modal {
    position: fixed;
    inset: 0;
    z-index: 1500;
    background: rgba(15, 23, 42, 0.58);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.upload-progress-card {
    width: min(100%, 360px);
    background: #ffffff;
    border-radius: 30px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24);
}

.upload-progress-circle {
    width: 92px;
    height: 92px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 950;
    margin-bottom: 16px;
}

.upload-progress-card h3 {
    margin: 0;
    color: var(--text);
    font-size: 21px;
    font-weight: 950;
}

.upload-progress-card p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13.5px;
    font-weight: 750;
}

.upload-progress-bar {
    height: 9px;
    border-radius: 99px;
    background: #e2e8f0;
    overflow: hidden;
    margin: 16px 0 10px;
}

.upload-progress-bar span {
    height: 100%;
    width: 0;
    display: block;
    background: var(--primary);
    border-radius: 99px;
    transition: width 0.16s ease;
}

.upload-progress-card small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

[hidden] {
    display: none !important;
}

@media (max-width: 920px) {
    body {
        background: var(--bg);
    }

    .upload-short-page {
        display: block;
        padding: 0;
        min-height: 100dvh;
    }

    .upload-short-device {
        width: 100%;
        min-height: 100dvh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        padding: calc(env(safe-area-inset-top, 0px) + 16px) 16px 36px;
    }

    .upload-short-side-panel {
        display: none;
    }
}

@media (max-width: 520px) {
    .upload-short-hero {
        border-radius: 26px;
        padding: 16px;
    }

    .upload-short-hero-icon {
        width: 56px;
        height: 56px;
        border-radius: 21px;
    }

    .form-card {
        border-radius: 24px;
        padding: 16px;
    }

    .media-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .media-picker-card {
        min-height: 122px;
        padding: 13px;
        border-radius: 22px;
    }
  
}
/* =========================================================
   FINAL CLEAN FIX: Shorts Video + Thumbnail Preview Framing
   Keep this at the VERY BOTTOM of upload-shorts.css
========================================================= */

.upload-short-page,
.upload-short-device,
.upload-short-form,
.form-card {
    max-width: 100% !important;
    overflow-x: hidden !important;
}

.upload-short-page .selected-files-list {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    margin-top: 13px !important;
    overflow: hidden !important;
}

.upload-short-page .short-preview-grid {
    width: 100% !important;
    max-width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 9px !important;
    overflow: hidden !important;
}

.upload-short-page .short-preview-card {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    border-radius: 15px !important;
    border: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.07) !important;
}

.upload-short-page .short-preview-thumb {
    width: 100% !important;
    height: 118px !important;
    min-height: 118px !important;
    max-height: 118px !important;
    position: relative !important;
    overflow: hidden !important;
    background: #020617 !important;
    border-radius: 15px 15px 0 0 !important;
}

.upload-short-page .short-preview-thumb img,
.upload-short-page .short-preview-thumb video,
.upload-short-page #selectedFilesList img,
.upload-short-page #selectedFilesList video {
    width: 100% !important;
    height: 118px !important;
    min-height: 118px !important;
    max-height: 118px !important;
    max-width: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
}

.upload-short-page .short-preview-card.is-video video {
    pointer-events: none !important;
}

.upload-short-page .short-preview-play {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 34px !important;
    height: 34px !important;
    border-radius: 999px !important;
    background: rgba(15, 23, 42, 0.76) !important;
    color: #ffffff !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 4 !important;
}

.upload-short-page .short-preview-play ion-icon {
    font-size: 20px !important;
    margin-left: 2px !important;
}

.upload-short-page .short-preview-remove {
    position: absolute !important;
    top: 6px !important;
    right: 6px !important;
    width: 25px !important;
    height: 25px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: #dc2626 !important;
    color: #ffffff !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 5 !important;
    padding: 0 !important;
}

.upload-short-page .short-preview-remove ion-icon {
    font-size: 16px !important;
}

.upload-short-page .short-preview-meta {
    padding: 7px !important;
    min-width: 0 !important;
    overflow: hidden !important;
}

.upload-short-page .short-preview-meta span {
    display: block !important;
    color: #dc2626 !important;
    font-size: 9.5px !important;
    font-weight: 950 !important;
    line-height: 1.15 !important;
    margin-bottom: 2px !important;
}

.upload-short-page .short-preview-meta strong {
    display: block !important;
    color: #0f172a !important;
    font-size: 10px !important;
    font-weight: 900 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.upload-short-page .short-preview-meta small {
    display: block !important;
    color: #64748b !important;
    font-size: 9px !important;
    font-weight: 800 !important;
    margin-top: 2px !important;
}

.upload-short-page .short-preview-empty {
    width: 100% !important;
    min-height: 56px !important;
    border: 1px dashed #94a3b8 !important;
    border-radius: 18px !important;
    background: #f8fafc !important;
    color: #64748b !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
}

@media (max-width: 390px) {
    .upload-short-page .short-preview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }

    .upload-short-page .short-preview-thumb,
    .upload-short-page .short-preview-thumb img,
    .upload-short-page .short-preview-thumb video,
    .upload-short-page #selectedFilesList img,
    .upload-short-page #selectedFilesList video {
        height: 102px !important;
        min-height: 102px !important;
        max-height: 102px !important;
    }

    .upload-short-page .short-preview-meta {
        padding: 6px !important;
    }

    .upload-short-page .short-preview-meta strong {
        font-size: 9.5px !important;
    }

    .upload-short-page .short-preview-meta span,
    .upload-short-page .short-preview-meta small {
        font-size: 8.8px !important;
    }
}


/* ===== GLOBAL FONT FAMILY ===== */

html,
body,
button,
input,
textarea,
select,
a,
p,
span,
strong,
small,
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}