/* =========================================================
   SUCCESS PICTURE AUDIO STUDIO
   Version 1.1
   ========================================================= */


/* ---------- MAIN EDITOR ---------- */

.sp-editor {
    width: 100%;
    max-width: 1280px;
    margin: 40px auto;
    padding: 36px;
    background: #ffffff;
    border: 1px solid #e8edf5;
    border-radius: 22px;
    box-shadow: 0 12px 45px rgba(20, 40, 80, 0.08);
    box-sizing: border-box;
    color: #172033;
}

.sp-editor *,
.sp-editor *::before,
.sp-editor *::after {
    box-sizing: border-box;
}


/* ---------- HEADER ---------- */

.sp-editor-header {
    text-align: center;
    max-width: 760px;
    margin: 0 auto 32px;
}

.sp-badge {
    display: inline-block;
    padding: 7px 13px;
    margin-bottom: 13px;
    background: #eef5ff;
    color: #075ee5;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.7px;
}

.sp-editor-header h1 {
    margin: 0 0 10px;
    font-size: 38px;
    line-height: 1.2;
    font-weight: 750;
    color: #15213a;
}

.sp-editor-header p {
    margin: 0;
    color: #647087;
    font-size: 16px;
    line-height: 1.7;
}


/* ---------- UPLOAD AREA ---------- */

.sp-upload-zone {
    position: relative;
    width: 100%;
    min-height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 45px 25px;
    border: 2px dashed #7caaff;
    border-radius: 18px;
    background: #f8fbff;
    text-align: center;
    transition: 0.2s ease;
    cursor: pointer;
}

.sp-upload-zone:hover {
    border-color: #1769e8;
    background: #f2f7ff;
}

.sp-upload-zone.sp-dragging {
    border-color: #075ee5;
    background: #eaf3ff;
    transform: scale(1.005);
}

.sp-file-input {
    display: none;
}

.sp-upload-content {
    pointer-events: none;
}

.sp-upload-icon {
    width: 74px;
    height: 74px;
    margin: 0 auto 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #e8f1ff;
    border-radius: 50%;
    color: #0866ed;
    font-size: 38px;
    font-weight: bold;
}

.sp-upload-content h2 {
    margin: 0 0 7px;
    color: #172033;
    font-size: 23px;
}

.sp-upload-content p {
    margin: 0 0 20px;
    color: #738096;
    font-size: 14px;
}

.sp-choose-file {
    pointer-events: auto;
    appearance: none;
    border: 0;
    padding: 13px 25px;
    background: #0866ed;
    color: #ffffff;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 650;
    cursor: pointer;
    transition: 0.2s ease;
}

.sp-choose-file:hover {
    background: #0554c7;
    transform: translateY(-1px);
}

.sp-format-text {
    margin-top: 17px;
    color: #8a96aa;
    font-size: 12px;
    font-weight: 600;
}


/* ---------- ERROR MESSAGE ---------- */

.sp-message {
    margin-top: 18px;
    padding: 14px 17px;
    border-radius: 10px;
    font-size: 14px;
}

.sp-error-message {
    border: 1px solid #ffc7c7;
    background: #fff3f3;
    color: #b42318;
}


/* ---------- FILE INFORMATION ---------- */

.sp-file-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 22px;
    padding: 18px;
    background: #f8fafc;
    border: 1px solid #e5eaf2;
    border-radius: 14px;
}

.sp-file-icon {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9f2ff;
    color: #0866ed;
    border-radius: 11px;
    font-size: 25px;
}

.sp-file-details {
    flex: 1;
    min-width: 0;
}

.sp-file-details > strong {
    display: block;
    margin-bottom: 7px;
    overflow: hidden;
    color: #1c2940;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-file-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    color: #738096;
    font-size: 12px;
}

.sp-file-meta strong {
    color: #4b5870;
}

.sp-remove-file {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    padding: 0;
    border: 0;
    background: #ffffff;
    color: #7a8799;
    border-radius: 50%;
    font-size: 25px;
    line-height: 38px;
    cursor: pointer;
}

.sp-remove-file:hover {
    background: #ffecec;
    color: #d92d20;
}


/* ---------- AUDIO PREVIEW ---------- */

.sp-audio-preview {
    margin-top: 18px;
}

.sp-audio-preview audio {
    display: block;
    width: 100%;
}


/* ---------- WORKSPACE ---------- */

.sp-workspace {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #e8edf5;
}


/* ---------- TOOLBAR ---------- */

.sp-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.sp-toolbar button {
    min-height: 42px;
    padding: 10px 18px;
    border: 1px solid #dce3ee;
    background: #ffffff;
    color: #344054;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.15s ease;
}

.sp-toolbar button:hover:not(:disabled) {
    border-color: #0866ed;
    color: #0866ed;
    background: #f4f8ff;
}

.sp-toolbar button:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}


/* ---------- EDITOR GRID ---------- */

.sp-editor-layout {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr) 230px;
    gap: 18px;
    align-items: stretch;
}


/* ---------- LEFT PANEL ---------- */

.sp-left-panel,
.sp-right-panel {
    padding: 19px;
    border: 1px solid #e5eaf2;
    background: #f9fbfd;
    border-radius: 14px;
}

.sp-left-panel h3,
.sp-right-panel h3 {
    margin: 0 0 18px;
    color: #27364e;
    font-size: 15px;
}

.sp-left-panel button {
    width: 100%;
    margin-bottom: 9px;
    padding: 10px 12px;
    border: 1px solid #dfe5ee;
    background: #ffffff;
    color: #445169;
    border-radius: 8px;
    text-align: left;
    font-size: 13px;
}

.sp-left-panel button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


/* ---------- CENTER / WAVEFORM ---------- */

.sp-center-panel {
    min-width: 0;
    padding: 18px;
    border: 1px solid #e5eaf2;
    background: #ffffff;
    border-radius: 14px;
}

.sp-waveform-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
    color: #69768b;
    font-size: 12px;
    font-weight: 600;
}

#waveform {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 11px;
    background:
        linear-gradient(
            90deg,
            rgba(8, 102, 237, 0.035) 1px,
            transparent 1px
        ),
        #f5f8fc;
    background-size: 25px 100%;
}

.sp-waveform-placeholder {
    text-align: center;
    color: #8a96aa;
}

.sp-waveform-placeholder span {
    display: block;
    margin-bottom: 8px;
    color: #8eb7f4;
    font-size: 35px;
}

.sp-waveform-placeholder p {
    margin: 0;
    font-size: 13px;
}


/* ---------- RIGHT CONTROLS ---------- */

.sp-control-group {
    margin-bottom: 23px;
}

.sp-control-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    color: #4c5970;
    font-size: 12px;
    font-weight: 650;
}

.sp-control-heading span {
    color: #0866ed;
}

.sp-control-group input[type="range"] {
    width: 100%;
    accent-color: #0866ed;
    cursor: pointer;
}

.sp-control-group input:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}


/* ---------- PRIVACY ---------- */

.sp-privacy-note {
    margin-top: 25px;
    padding: 13px 15px;
    border: 1px solid #dce9df;
    background: #f5fbf6;
    color: #4f6655;
    border-radius: 10px;
    text-align: center;
    font-size: 12px;
    line-height: 1.6;
}


/* ---------- HIDDEN ELEMENTS ---------- */

.sp-editor [hidden] {
    display: none !important;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1000px) {

    .sp-editor {
        padding: 28px;
    }

    .sp-editor-layout {
        grid-template-columns: 170px minmax(0, 1fr);
    }

    .sp-right-panel {
        grid-column: 1 / -1;
    }

    .sp-right-panel {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
    }

    .sp-right-panel h3 {
        grid-column: 1 / -1;
        margin-bottom: 0;
    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 700px) {

    .sp-editor {
        margin: 20px auto;
        padding: 18px;
        border-radius: 15px;
    }

    .sp-editor-header {
        margin-bottom: 24px;
    }

    .sp-editor-header h1 {
        font-size: 28px;
    }

    .sp-editor-header p {
        font-size: 14px;
    }

    .sp-upload-zone {
        min-height: 260px;
        padding: 35px 15px;
    }

    .sp-upload-content h2 {
        font-size: 20px;
    }

    .sp-file-card {
        align-items: flex-start;
    }

    .sp-file-meta {
        flex-direction: column;
        gap: 3px;
    }

    .sp-editor-layout {
        display: block;
    }

    .sp-left-panel,
    .sp-center-panel,
    .sp-right-panel {
        margin-bottom: 15px;
    }

    .sp-left-panel {
        display: none;
    }

    .sp-right-panel {
        display: block;
    }

    #waveform {
        height: 200px;
    }

    .sp-toolbar {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 5px;
    }

    .sp-toolbar button {
        flex: 0 0 auto;
    }

}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 420px) {

    .sp-editor {
        padding: 14px;
    }

    .sp-editor-header h1 {
        font-size: 24px;
    }

    .sp-upload-zone {
        min-height: 230px;
    }

    .sp-upload-icon {
        width: 60px;
        height: 60px;
        font-size: 30px;
    }

    .sp-choose-file {
        width: 100%;
    }

}

/* =========================================
   AUDIO WAVEFORM WORKSPACE
   ========================================= */

.sp-audio-workspace {
    margin-top: 30px;
    padding: 24px;
    background: #f8faff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
}

.sp-file-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 18px;
    font-size: 16px;
}

#spFileName {
    color: #17233c;
}

#spAudioDuration {
    color: #64748b;
    font-weight: 600;
}

.sp-waveform-container {
    width: 100%;
    background: #ffffff;
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    overflow: hidden;
}

#spWaveform {
    width: 100%;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.sp-waveform-placeholder {
    color: #8a98ad;
    font-size: 17px;
    text-align: center;
}
