* {
    box-sizing: border-box;
}


/* =========================
   BODY
========================= */

body {
    margin: 0;
    min-height: 100vh;

    display: flex;
    justify-content: center;
    align-items: center;

    background: #222;

    font-family: Arial, sans-serif;

    padding: 100px 20px 30px;
}


/* =========================
   MAIN CONTAINER
========================= */

.container {
    width: min(1400px, 100%);

    padding: 25px;

    background: #222;

    border-radius: 12px;
}


/* =========================
   VIEW MODE
========================= */

.view-list {
    width: 100%;

    padding: 18px;

    background: #222;

    border: 2px solid transparent;
    border-radius: 10px;

    box-shadow:
        0 5px 25px rgba(0, 0, 0, 1);
}


.view-video-list {
    width: 100%;

    padding: 5px;
}


.view-video-row {
    display: flex;
    align-items: center;

    width: 100%;
    height: 180px;

    gap: 18px;

    margin-bottom: 18px;
}


.view-video-number {
    min-width: 65px;

    margin: 0 10px 0 5px;
    padding-bottom: 5px;

    border-bottom: 3px solid white;

    color: white;

    font-size: 52px;
    font-weight: bold;

    text-align: center;
}


.view-video-row iframe {
    width: 100%;
    height: 180px;

    flex: 1;

    min-width: 0;

    border: none;
    border-radius: 8px;
}


/* =========================
   TWO COLUMNS
========================= */

.music-columns {
    display: grid;

    grid-template-columns:
        minmax(0, 1.3fr)
        minmax(0, 0.7fr);

    gap: 30px;
}


.music-section {
    min-width: 0;
    min-height: 300px;

    padding: 18px;

    display: flex;
    flex-direction: column;

    background: #222;

    border: 2px solid transparent;
    border-radius: 10px;

    box-shadow:
        0 5px 25px rgba(0, 0, 0, 1);

    transition: all 0.2s ease;
}


/* =========================
   ADD VIDEO
========================= */

.add-video-form {
    display: flex;

    gap: 10px;

    margin-bottom: 20px;
}


.add-video-form input {
    flex: 1;

    width: auto;
    min-width: 0;

    padding: 12px;

    border: 1px solid #ccc;
    border-radius: 6px;

    font-size: 15px;
}


.add-video-form button {
    padding: 12px 18px;

    border: none;
    border-radius: 6px;

    background: #333;

    color: white;

    font-weight: bold;

    cursor: pointer;
}


.add-video-form button:hover {
    background: #444;
}


/* =========================
   VIDEO LIST
========================= */

.video-list {
    flex: 1;

    min-height: 0;

    padding: 5px;
}


/* =========================
   VIDEO ROW
========================= */

.video-row {
    display: flex;
    align-items: center;

    width: 100%;
    height: 180px;

    gap: 12px;

    margin-bottom: 18px;
    padding: 0;

    border: 2px solid transparent;
    border-radius: 8px;

    transition: all 0.2s ease;
}


.video-row.dragging {
    opacity: 0.4;

    transform: scale(0.98);
}


/* =========================
   DRAGGING RESIZE
========================= */

.video-list.dragging-active .video-row:not(.dragging) {
    height: 150px;

    margin-bottom: 12px;
}


.video-list.dragging-active
.video-row:not(.dragging)
.drag-handle {
    height: 150px;
}


.video-list.dragging-active
.video-row:not(.dragging)
.move-controls {
    height: 150px;
}


.video-list.dragging-active
.video-row:not(.dragging)
.move-controls
.move-button {
    flex: 1;

    height: auto;
}


.video-list.dragging-active
.video-row:not(.dragging)
iframe {
    height: 150px;
}


.video-list.dragging-active
.video-row:not(.dragging)
.delete-button {
    height: 150px;
}


/* =========================
   DRAG HANDLE
========================= */

.drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 30px;
    height: 180px;

    flex-shrink: 0;

    background: #333;

    border-radius: 6px;

    color: #222;

    font-size: 30px;

    cursor: grab;
    user-select: none;

    touch-action: pan-y;

    transition: all 0.2s ease;
}


.drag-handle:hover {
    background: #444;
}


.drag-handle:active {
    background: #d0e8ff;

    color: #1976d2;

    cursor: grabbing;
}


/* =========================
   VIDEO NUMBER
========================= */

.video-number {
    min-width: 52px;

    margin: 0 14px 0 6px;
    padding-bottom: 5px;

    border-bottom: 3px solid white;

    color: white;

    font-size: 52px;
    font-weight: bold;

    text-align: center;
}


/* =========================
   MOVE CONTROLS
========================= */

.move-controls {
    display: flex;
    flex-direction: column;

    width: 20px;
    height: 180px;

    flex-shrink: 0;

    gap: 12px;

    margin-left: 2px;
}


.move-button {
    width: 20px;
    height: 89px;

    flex: 1;

    padding: 0;

    border: none;
    border-radius: 4px;

    background: #004488;

    color: white;

    font-size: 40px;
    font-weight: bold;

    line-height: 1;

    cursor: pointer;
}


.move-button:hover {
    background: #125ca5;
}


/* =========================
   YOUTUBE VIDEO
========================= */

.video-row iframe {
    width: 100%;
    height: 180px;

    flex: 1;

    min-width: 0;

    margin: 0;

    border: none;
    border-radius: 8px;
}


/* =========================
   DELETE BUTTON
========================= */

.delete-button {
    display: flex;
    align-items: center;
    justify-content: center;

    position: relative;

    width: 20px;
    height: 180px;

    flex-shrink: 0;

    padding: 0;

    overflow: hidden;

    border: none;
    border-radius: 6px;

    background: #990000;

    color: white;

    font-size: 20px;
    font-weight: bold;

    cursor: pointer;

    z-index: 1;
}


.delete-button:hover {
    background: #b71c1c;
}


/* =========================
   INSERTION POINT
========================= */

.insertion-point {
    position: relative;

    height: 0;

    margin: 0;

    opacity: 0;

    pointer-events: none;

    background: transparent;

    border: none;
    border-radius: 45px;

    cursor: pointer;

    transition: all 0.15s ease;
}


.video-list.dragging-active .insertion-point {
    height: 30px;

    margin: 14px 0;

    opacity: 1;

    pointer-events: auto;

    background: #4caf50;
}


.video-list.dragging-active
.insertion-point.insertion-disabled {
    display: none;

    height: 0;

    margin: 0;

    opacity: 0;

    pointer-events: none;
}


/* =========================
   START MESSAGE
========================= */

#start-message {
    padding: 30px 15px;

    color: #555;

    font-size: 16px;

    text-align: center;
}


/* =========================
   MOBILE — COLUMNS
========================= */

@media (max-width: 900px) {

    .music-columns {
        grid-template-columns: 1fr;

        gap: 20px;
    }

}


/* =========================
   MOBILE — GENERAL
========================= */

@media (max-width: 700px) {

    body {
        align-items: flex-start;

        padding: 100px 10px 20px;
    }


    .container {
        width: 100%;

        padding: 18px;
    }


    .music-section {
        padding: 12px;
    }


    .video-row {
        gap: 7px;
    }


    .drag-handle {
        width: 25px;

        font-size: 21px;
    }


    .video-number {
        font-size: 19px;
    }


    .delete-button {
        padding: 7px 8px;

        font-size: 12px;
    }


    .view-video-row {
        gap: 7px;
    }


    .view-video-number {
        min-width: 35px;

        margin: 0 4px;

        font-size: 28px;
    }

}


/* =========================
   MOBILE — ADD FORM
========================= */

@media (max-width: 500px) {

    .add-video-form {
        flex-direction: column;
    }


    .add-video-form input,
    .add-video-form button {
        width: 100%;
    }


    .view-video-row {
        height: auto;

        align-items: stretch;
    }


    .view-video-row iframe {
        height: 160px;
    }


    .view-video-number {
        display: flex;
        align-items: center;

        min-width: 30px;

        font-size: 24px;
    }

}


/* =========================
   SMALL MOBILE
========================= */

@media (max-width: 450px) {

    .video-row {
        gap: 4px;
    }


    .drag-handle {
        width: 20px;

        font-size: 18px;
    }


    .video-number {
        font-size: 17px;
    }


    .delete-button {
        padding: 6px;

        font-size: 11px;
    }


    .view-video-row iframe {
        height: 140px;
    }

}