* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    min-height: 100vh;

    font-family: Arial, sans-serif;

    background: #111315;
    color: #eeeeee;
}


/* ==================================================
   HOVEDLAYOUT
================================================== */

.audio-editor {
    min-height: 100vh;

    display: grid;

    grid-template-columns:
        320px
        1fr;
}


/* ==================================================
   VENSTRE SIDE
================================================== */

.sidebar {
    min-height: 100vh;

    padding: 45px 30px;

    display: flex;
    flex-direction: column;

    background: #191c1f;

    border-right: 1px solid #34383c;
}


/* ==================================================
   TITEL
================================================== */

.title-area {
    margin-bottom: 50px;
}

.small-title {
    margin-bottom: 10px;

    font-size: 10px;
    font-weight: bold;

    letter-spacing: 3px;

    color: #777f85;
}

h1 {
    margin: 0;

    font-size: 54px;

    line-height: 0.88;

    letter-spacing: -3px;
}

.title-area p {
    margin: 20px 0 0;

    max-width: 240px;

    font-size: 13px;
    line-height: 1.6;

    color: #858d92;
}


/* ==================================================
   SEKTIONSTITLER
================================================== */

.section-title {
    margin-bottom: 12px;

    font-size: 10px;
    font-weight: bold;

    letter-spacing: 2px;

    color: #6f777c;
}


/* ==================================================
   UPLOAD
================================================== */

.upload-section {
    margin-bottom: 40px;
}

.upload-box {
    min-height: 130px;

    padding: 20px;

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

    text-align: center;

    border: 1px dashed #52595e;

    cursor: pointer;

    transition:
        border-color 0.2s,
        background 0.2s;
}

.upload-box:hover,
.upload-box.dragover {
    border-color: #b5bcc0;

    background: #202428;
}

.upload-icon {
    width: 35px;
    height: 35px;

    margin-bottom: 12px;

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

    border: 1px solid #777f84;

    border-radius: 50%;

    font-size: 23px;

    color: #c4c9cc;
}

.upload-text {
    max-width: 190px;

    font-size: 12px;
    font-weight: bold;

    line-height: 1.4;

    color: #c1c6c9;
}

.upload-types {
    margin-top: 8px;

    font-size: 9px;

    letter-spacing: 1px;

    color: #626a6f;
}


/* ==================================================
   EKSEMPLER
================================================== */

.examples-section {
    margin-top: auto;
}

.example-list {
    border-top: 1px solid #363b3f;
}

.example-button {
    width: 100%;

    padding: 14px 5px;

    display: flex;
    align-items: center;

    gap: 15px;

    border: none;
    border-bottom: 1px solid #363b3f;

    background: transparent;

    color: #aeb4b7;

    font-size: 12px;
    text-align: left;

    cursor: pointer;

    transition:
        color 0.15s,
        padding-left 0.15s,
        background 0.15s;
}

.example-button span {
    font-family: "Courier New", monospace;

    font-size: 10px;

    color: #5d656a;
}

.example-button:hover {
    padding-left: 10px;

    background: #202428;

    color: white;
}

.example-button.active {
    background: #252a2e;

    color: white;
}


/* ==================================================
   WORKSPACE
================================================== */

.workspace {
    min-width: 0;

    min-height: 100vh;

    padding:
        45px
        clamp(35px, 6vw, 90px);

    display: flex;
    flex-direction: column;
}


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

.file-header {
    display: flex;
    justify-content: space-between;
    align-items: end;

    gap: 30px;

    margin-bottom: 40px;
}

.file-label {
    margin-bottom: 7px;

    font-size: 9px;
    font-weight: bold;

    letter-spacing: 2px;

    color: #626a6f;
}

.file-name {
    max-width: 600px;

    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;

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

    color: #d9dddf;
}

.duration {
    flex-shrink: 0;

    font-family: "Courier New", monospace;

    font-size: 15px;

    color: #7e878c;
}

#currentTime {
    color: #e2e5e6;
}

.time-divider {
    margin: 0 4px;

    color: #4d5458;
}


/* ==================================================
   WAVEFORM
================================================== */

.waveform-container {
    position: relative;

    width: 100%;
    height: clamp(240px, 40vh, 420px);

    overflow: hidden;

    cursor: pointer;

    background:
        repeating-linear-gradient(
            0deg,
            transparent 0,
            transparent 49px,
            rgba(255,255,255,0.035) 50px
        ),
        repeating-linear-gradient(
            90deg,
            transparent 0,
            transparent 79px,
            rgba(255,255,255,0.035) 80px
        ),
        #0c0e10;

    border-top: 1px solid #353a3e;
    border-bottom: 1px solid #353a3e;
}


/* MIDTERLINJE */

.waveform-container::before {
    content: "";

    position: absolute;

    left: 0;
    right: 0;
    top: 50%;

    height: 1px;

    background: #353a3e;

    pointer-events: none;

    z-index: 1;
}


/* CANVAS */

#waveform {
    position: absolute;

    inset: 0;

    display: block;

    width: 100%;
    height: 100%;

    z-index: 2;
}


/* PLAYHEAD */

.playhead {
    position: absolute;

    left: 0;
    top: 0;

    width: 2px;
    height: 100%;

    background: #e5e5e5;

    opacity: 0;

    pointer-events: none;

    z-index: 4;
}

.playhead::before {
    content: "";

    position: absolute;

    top: 0;
    left: 50%;

    width: 9px;
    height: 9px;

    transform:
        translateX(-50%)
        rotate(45deg);

    background: #e5e5e5;
}


/* TOM WAVEFORM */

.empty-waveform {
    position: absolute;

    inset: 0;

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

    gap: 18px;

    color: #50575b;

    font-size: 11px;

    letter-spacing: 1px;

    pointer-events: none;

    z-index: 3;
}

.empty-line {
    width: min(300px, 60%);
    height: 1px;

    background: #34393d;
}


/* ==================================================
   RETNING
================================================== */

.direction-area {
    min-height: 110px;

    display: grid;

    grid-template-columns:
        1fr
        90px
        1fr;

    align-items: stretch;

    border-bottom: 1px solid #353a3e;
}

.direction-button {
    padding: 20px 25px;

    display: flex;
    align-items: center;

    gap: 20px;

    border: none;

    background: transparent;

    color: #697176;

    cursor: pointer;

    text-align: left;

    transition:
        color 0.2s,
        background 0.2s;
}

.direction-button:hover {
    background: #171a1d;

    color: #c8cdd0;
}

.direction-button.active {
    color: white;

    background: #1a1e21;
}

.direction-button.reverse {
    justify-content: flex-end;

    text-align: right;
}

.direction-icon {
    font-size: 30px;
}

.direction-info {
    display: flex;
    flex-direction: column;

    gap: 5px;
}

.direction-info strong {
    font-size: 13px;

    letter-spacing: 2px;
}

.direction-info small {
    font-size: 10px;

    color: #60686d;
}

.direction-button.active small {
    color: #8f979b;
}


/* RETNING MIDT */

.direction-divider {
    display: flex;
    justify-content: center;
    align-items: center;

    position: relative;

    color: #4d5559;

    font-size: 8px;
    font-weight: bold;

    letter-spacing: 2px;
}

.direction-divider::before {
    content: "";

    position: absolute;

    top: 20px;
    bottom: 20px;

    left: 50%;

    width: 1px;

    background: #303539;
}

.direction-divider span {
    position: relative;

    padding: 8px 0;

    background: #111315;

    z-index: 2;
}


/* ==================================================
   TRANSPORT
================================================== */

.transport {
    flex: 1;

    min-height: 150px;

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

    gap: 25px;
}

.transport button {
    border: none;

    color: white;

    cursor: pointer;
}

.transport-button {
    width: 48px;
    height: 48px;

    border-radius: 50% !important;

    background: #252a2e;

    font-size: 17px;
}

.transport-button:hover:not(:disabled) {
    background: #343a3f;
}

.play-button {
    width: 76px;
    height: 76px;

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

    padding-left: 5px;

    border-radius: 50%;

    background: #eeeeee;

    color: #111315 !important;

    font-size: 25px;
}

.play-button:hover:not(:disabled) {
    background: white;
}

.transport button:disabled {
    opacity: 0.2;

    cursor: default;
}


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

.status-bar {
    min-height: 50px;

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

    gap: 30px;

    border-top: 1px solid #353a3e;

    font-family: "Courier New", monospace;

    font-size: 11px;

    color: #9ca3a7;
}

.status-label {
    margin-right: 10px;

    font-family: Arial, sans-serif;

    font-size: 8px;
    font-weight: bold;

    letter-spacing: 2px;

    color: #4f575b;
}


/* ==================================================
   MOBIL
================================================== */

@media (max-width: 800px) {

    .audio-editor {
        display: block;
    }

    .sidebar {
        min-height: auto;

        padding: 30px 20px;

        border-right: none;
        border-bottom: 1px solid #34383c;
    }

    .title-area {
        margin-bottom: 30px;
    }

    h1 {
        font-size: 46px;
    }

    .examples-section {
        margin-top: 0;
    }

    .workspace {
        min-height: auto;

        padding: 30px 20px;
    }

    .file-header {
        margin-bottom: 25px;

        align-items: start;
        flex-direction: column;

        gap: 10px;
    }

    .waveform-container {
        height: 250px;
    }

    .direction-area {
        grid-template-columns:
            1fr
            45px
            1fr;
    }

    .direction-button {
        padding: 15px 10px;

        gap: 10px;
    }

    .direction-info small {
        display: none;
    }

    .direction-icon {
        font-size: 22px;
    }

    .transport {
        min-height: 140px;
    }

}