/* =========================================================
   BEYOND REAL ESTATE
   VIDEO POST COMPOSER
========================================================= */

.video-post-modal {
    position: fixed;
    inset: 0;
    z-index: 9999999;

    display: none;

    align-items: center;
    justify-content: center;

    padding: 20px;

    visibility: hidden;
    opacity: 0;

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease;
}


/* =========================================================
   OPEN STATE
========================================================= */

.video-post-modal.open {
    display: flex;

    visibility: visible;
    opacity: 1;
}


/* =========================================================
   OVERLAY
========================================================= */

.video-post-overlay {
    position: absolute;
    inset: 0;

    background: rgba(0, 0, 0, 0.65);

    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}


/* =========================================================
   DIALOG
========================================================= */

.video-post-dialog {
    position: relative;

    z-index: 2;

    width: 100%;
    max-width: 650px;

    max-height: calc(100vh - 40px);

    display: flex;
    flex-direction: column;

    background: #fff;

    border-radius: 18px;

    overflow: hidden;

    box-shadow:
        0 25px 70px rgba(0, 0, 0, 0.25);

    transform: translateY(20px) scale(0.98);

    transition:
        transform 0.25s ease;
}


.video-post-modal.open .video-post-dialog {
    transform: translateY(0) scale(1);
}


/* =========================================================
   HEADER
========================================================= */

.video-post-header {
    display: flex;

    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;

    padding: 22px 24px;

    border-bottom: 1px solid #eee;
}


.video-post-header h2 {
    margin: 0 0 5px;

    font-size: 22px;
    font-weight: 700;

    color: #111827;
}


.video-post-header p {
    margin: 0;

    font-size: 14px;

    color: #6b7280;
}


.video-post-close {
    width: 38px;
    height: 38px;

    flex-shrink: 0;

    border: 0;

    border-radius: 50%;

    background: #f3f4f6;

    color: #374151;

    font-size: 24px;

    line-height: 1;

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    transition: 0.2s ease;
}


.video-post-close:hover {
    background: #e5e7eb;
}


/* =========================================================
   BODY
========================================================= */

.video-post-body {
    padding: 24px;

    overflow-y: auto;

    flex: 1;
}


/* =========================================================
   DROP ZONE
========================================================= */

.video-drop-zone {
    border: 2px dashed #d1d5db;

    border-radius: 16px;

    padding: 40px 20px;

    text-align: center;

    background: #f9fafb;

    transition: 0.2s ease;
}


.video-drop-zone:hover {
    border-color: #198754;

    background: #f7fffa;
}


.video-upload-icon {
    width: 64px;
    height: 64px;

    margin: 0 auto 15px;

    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #e8f7ef;

    color: #198754;

    font-size: 27px;
}


.video-drop-zone h3 {
    margin: 0 0 7px;

    font-size: 19px;

    color: #111827;
}


.video-drop-zone p {
    margin: 0 0 18px;

    font-size: 14px;

    color: #6b7280;
}


.video-select-btn {
    border: 0;

    border-radius: 9px;

    padding: 11px 18px;

    background: #198754;

    color: #fff;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    transition: 0.2s ease;
}


.video-select-btn:hover {
    background: #157347;
}


.video-upload-hint {
    display: block;

    margin-top: 14px;

    color: #9ca3af;

    font-size: 12px;
}


/* =========================================================
   VIDEO PREVIEW
========================================================= */

.video-preview-container {
    margin-bottom: 22px;
}


.video-preview-container[hidden] {
    display: none;
}


.video-preview-wrapper {
    position: relative;

    width: 100%;

    background: #000;

    border-radius: 14px;

    overflow: hidden;
}


.video-preview-wrapper video {
    display: block;

    width: 100%;

    max-height: 350px;

    background: #000;
}


.video-remove-btn {
    position: absolute;

    top: 12px;
    right: 12px;

    width: 36px;
    height: 36px;

    border: 0;

    border-radius: 50%;

    background: rgba(0, 0, 0, 0.7);

    color: #fff;

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;
}


.video-remove-btn:hover {
    background: rgba(220, 38, 38, 0.9);
}


/* =========================================================
   VIDEO METADATA
========================================================= */

.video-metadata {
    display: flex;

    flex-wrap: wrap;

    gap: 8px;

    margin-top: 10px;
}


.video-metadata span {
    padding: 5px 9px;

    border-radius: 6px;

    background: #f3f4f6;

    color: #4b5563;

    font-size: 12px;
}


#videoFileName {
    max-width: 55%;

    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;
}


/* =========================================================
   FORM
========================================================= */

.video-form-group {
    margin-top: 20px;
}


.video-form-group label {
    display: block;

    margin-bottom: 8px;

    font-size: 14px;

    font-weight: 600;

    color: #374151;
}


.video-form-group textarea,
.video-form-group select {
    width: 100%;

    box-sizing: border-box;

    border: 1px solid #d1d5db;

    border-radius: 10px;

    padding: 12px 13px;

    background: #fff;

    color: #111827;

    font-family: inherit;

    font-size: 14px;

    outline: none;

    transition: 0.2s ease;
}


.video-form-group textarea {
    resize: vertical;

    min-height: 120px;
}


.video-form-group textarea:focus,
.video-form-group select:focus {
    border-color: #198754;

    box-shadow:
        0 0 0 3px rgba(25, 135, 84, 0.10);
}


.video-description-footer {
    display: flex;

    justify-content: space-between;

    gap: 15px;

    margin-top: 6px;

    font-size: 12px;

    color: #9ca3af;
}


/* =========================================================
   STATUS
========================================================= */

.video-upload-status {
    margin-top: 18px;

    padding: 11px 13px;

    border-radius: 9px;

    font-size: 13px;
}


.video-upload-status[hidden] {
    display: none;
}


.video-upload-status.success {
    background: #e8f7ef;

    color: #146c43;
}


.video-upload-status.error {
    background: #fdecec;

    color: #b42318;
}


.video-upload-status.loading {
    background: #eef4ff;

    color: #1d4ed8;
}


/* =========================================================
   PROGRESS
========================================================= */

.video-upload-progress {
    margin-top: 18px;
}


.video-upload-progress[hidden] {
    display: none;
}


.video-progress-top,
.video-progress-bottom {
    display: flex;

    justify-content: space-between;

    gap: 15px;

    font-size: 12px;
}


.video-progress-top {
    margin-bottom: 8px;

    color: #374151;
}


.video-progress-bottom {
    margin-top: 7px;

    color: #6b7280;
}


.video-progress-track {
    width: 100%;

    height: 8px;

    border-radius: 20px;

    overflow: hidden;

    background: #e5e7eb;
}


.video-progress-bar {
    height: 100%;

    width: 0;

    border-radius: inherit;

    background: #198754;

    transition: width 0.2s ease;
}


/* =========================================================
   FOOTER
========================================================= */

.video-post-footer {
    display: flex;

    align-items: center;

    justify-content: flex-end;

    gap: 10px;

    padding: 18px 24px;

    border-top: 1px solid #eee;

    background: #fff;
}


.video-cancel-btn,
.video-submit-btn {
    border: 0;

    border-radius: 9px;

    padding: 11px 17px;

    font-size: 14px;

    font-weight: 600;

    cursor: pointer;
}


.video-cancel-btn {
    background: #f3f4f6;

    color: #374151;
}


.video-submit-btn {
    background: #198754;

    color: #fff;
}


.video-submit-btn:hover:not(:disabled) {
    background: #157347;
}


.video-submit-btn:disabled {
    opacity: 0.5;

    cursor: not-allowed;
}


.video-submit-btn.uploading {
    cursor: wait;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 600px) {

    .video-post-modal {
        padding: 0;
    }


    .video-post-dialog {
        width: 100%;

        max-width: none;

        height: 100vh;

        max-height: none;

        border-radius: 0;
    }


    .video-post-header {
        padding: 18px;
    }


    .video-post-body {
        padding: 18px;
    }


    .video-post-footer {
        padding: 14px 18px;

        padding-bottom:
            calc(14px + env(safe-area-inset-bottom));
    }


    .video-drop-zone {
        padding: 30px 15px;
    }


    .video-submit-btn {
        flex: 1;
    }


    .video-cancel-btn {
        flex-shrink: 0;
    }

}
