/* =========================================================
   Tutorial Studio
   Video Extract Audio
========================================================= */

* {
    box-sizing: border-box;
}


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


body {
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "Microsoft YaHei",
        Arial,
        sans-serif;

    background: #f5f7fa;

    color: #172033;
}


button,
select {
    font: inherit;
}


button {
    cursor: pointer;
}


.page {
    width: min(1440px,
            calc(100% - 48px));

    margin: 0 auto;

    padding: 36px 0 60px;
}


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

.page-header {
    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    gap: 32px;

    margin-bottom: 28px;
}


.breadcrumb {
    font-size: 13px;

    color: #8a94a6;

    margin-bottom: 10px;
}


.breadcrumb span {
    margin: 0 7px;

    color: #c2c8d1;
}


.page-header h1 {
    margin: 0;

    font-size: 30px;

    font-weight: 700;

    letter-spacing: -0.5px;
}


.page-header p {
    margin: 10px 0 0;

    color: #7b8494;

    font-size: 14px;
}


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

.ffmpeg-status {
    display: inline-flex;

    align-items: center;

    gap: 8px;

    padding: 9px 14px;

    border-radius: 20px;

    background: #fff;

    border: 1px solid #e5e9ef;

    font-size: 13px;

    color: #667085;

    white-space: nowrap;
}


.status-dot {
    width: 7px;

    height: 7px;

    border-radius: 50%;

    background: #a0a8b5;
}


.ffmpeg-status.ok .status-dot {
    background: #22a06b;
}


.ffmpeg-status.error .status-dot {
    background: #d64545;
}


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

.workspace {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr) 340px;

    gap: 24px;

    align-items: start;
}


/* =========================================================
   CARDS
========================================================= */

.main-card,
.settings-card {
    background: #fff;

    border: 1px solid #e7ebf0;

    border-radius: 16px;

    box-shadow:
        0 8px 30px rgba(20, 32, 56, 0.05);
}


.main-card {
    padding: 24px;
}


.settings-card {
    padding: 24px;
}


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

.drop-zone {
    min-height: 390px;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    text-align: center;

    padding: 50px 30px;

    border: 1.5px dashed #ccd3dd;

    border-radius: 14px;

    background: #fafbfc;

    transition:
        border-color .2s,
        background .2s;
}


.drop-zone.dragover {
    border-color: #5b7cff;

    background: #f5f7ff;
}


.upload-icon {
    width: 62px;

    height: 62px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 16px;

    background: #f0f3f8;

    color: #4e5d78;

    font-size: 28px;

    margin-bottom: 20px;
}


.drop-zone h2 {
    margin: 0;

    font-size: 21px;
}


.drop-zone p {
    margin: 9px 0 0;

    color: #8a94a6;

    font-size: 14px;
}


.drop-zone .upload-limit {
    margin-top: 5px;

    font-size: 12px;

    color: #a1a9b6;
}


.primary-button {
    margin-top: 24px;

    border: 0;

    border-radius: 9px;

    padding: 11px 24px;

    background: #172033;

    color: #fff;

    font-size: 14px;

    font-weight: 600;
}


.primary-button:hover {
    opacity: .9;
}


/* =========================================================
   FILE INFO
========================================================= */

.file-info {
    display: grid;

    grid-template-columns:
        minmax(280px, 42%) minmax(0, 1fr);

    gap: 24px;
}


.file-preview {
    overflow: hidden;

    border-radius: 12px;

    background: #101318;

    aspect-ratio: 16 / 9;
}


.file-preview video {
    width: 100%;

    height: 100%;

    display: block;

    object-fit: contain;
}


.file-details {
    min-width: 0;
}


.file-title-row {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 16px;

    padding-bottom: 20px;

    border-bottom: 1px solid #edf0f4;
}


.file-title-row strong {
    min-width: 0;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;

    font-size: 16px;
}


.text-button {
    flex: none;

    border: 0;

    background: transparent;

    color: #7d8797;

    font-size: 13px;
}


.text-button:hover {
    color: #d64545;
}


.file-meta {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 18px;

    padding-top: 20px;
}


.file-meta div {
    display: flex;

    flex-direction: column;

    gap: 6px;
}


.file-meta span {
    color: #98a1af;

    font-size: 12px;
}


.file-meta strong {
    font-size: 14px;

    font-weight: 600;

    word-break: break-word;
}


/* =========================================================
   SETTINGS
========================================================= */

.card-title {
    margin-bottom: 26px;
}


.card-title h2 {
    margin: 0;

    font-size: 19px;
}


.card-title p {
    margin: 7px 0 0;

    color: #8a94a6;

    font-size: 13px;
}


.form-group {
    margin-bottom: 22px;
}


.form-group label {
    display: block;

    margin-bottom: 8px;

    font-size: 13px;

    font-weight: 600;
}


.form-group select {
    width: 100%;

    height: 42px;

    padding: 0 12px;

    border: 1px solid #dfe4eb;

    border-radius: 8px;

    background: #fff;

    color: #273247;

    outline: none;
}


.form-group select:focus {
    border-color: #9ba9c1;
}


.form-group select:disabled {
    background: #f4f5f7;

    color: #a1a8b4;

    cursor: not-allowed;
}


.form-help {
    margin-top: 7px;

    color: #98a1af;

    font-size: 11px;
}


.form-group.disabled .form-help {
    color: #b0b6c0;
}


/* =========================================================
   DESCRIPTION
========================================================= */

.format-description {
    padding: 15px;

    border-radius: 10px;

    background: #f7f8fa;

    margin-top: 4px;

    margin-bottom: 22px;
}


.format-description strong {
    display: block;

    font-size: 13px;
}


.format-description p {
    margin: 6px 0 0;

    color: #7e8795;

    line-height: 1.6;

    font-size: 12px;
}


/* =========================================================
   SUMMARY
========================================================= */

.summary {
    border-top: 1px solid #edf0f4;

    padding-top: 20px;

    margin-top: 6px;

    margin-bottom: 22px;
}


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

    font-size: 12px;

    color: #98a1af;
}


.summary-row {
    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: 7px 0;
}


.summary-row span {
    color: #7e8795;

    font-size: 13px;
}


.summary-row strong {
    font-size: 13px;
}


/* =========================================================
   BUTTON
========================================================= */

.convert-button {
    width: 100%;

    height: 46px;

    border: 0;

    border-radius: 9px;

    background: #172033;

    color: #fff;

    font-size: 14px;

    font-weight: 600;

    transition:
        opacity .2s,
        transform .2s;
}


.convert-button:hover:not(:disabled) {
    opacity: .92;

    transform: translateY(-1px);
}


.convert-button:disabled {
    background: #c7ccd4;

    cursor: not-allowed;
}


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

.progress-panel {
    margin-top: 24px;

    padding: 20px;

    border: 1px solid #e8ecf1;

    border-radius: 12px;

    background: #fafbfc;
}


.progress-header {
    display: flex;

    align-items: center;

    justify-content: space-between;

    font-size: 13px;
}


.progress-track {
    height: 7px;

    margin-top: 12px;

    border-radius: 10px;

    overflow: hidden;

    background: #e9edf2;
}


.progress-bar {
    width: 0;

    height: 100%;

    border-radius: inherit;

    background: #172033;

    transition: width .25s ease;
}


.progress-panel p {
    margin: 10px 0 0;

    color: #8a94a6;

    font-size: 12px;
}


/* =========================================================
   RESULT
========================================================= */

.result-panel {
    display: flex;

    align-items: center;

    gap: 14px;

    margin-top: 24px;

    padding: 16px;

    border: 1px solid #dcefe5;

    border-radius: 12px;

    background: #f7fcf9;
}


.result-icon {
    width: 36px;

    height: 36px;

    display: flex;

    align-items: center;

    justify-content: center;

    flex: none;

    border-radius: 50%;

    background: #e4f5eb;

    color: #1f8a59;

    font-weight: 700;
}


.result-content {
    min-width: 0;

    flex: 1;

    display: flex;

    flex-direction: column;

    gap: 4px;
}


.result-content strong {
    font-size: 14px;
}


.result-content span {
    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;

    color: #788392;

    font-size: 12px;
}


.download-button {
    flex: none;

    padding: 9px 16px;

    border-radius: 8px;

    background: #172033;

    color: #fff;

    text-decoration: none;

    font-size: 13px;

    font-weight: 600;
}


/* =========================================================
   LOG
========================================================= */

.log-panel {
    margin-top: 20px;

    border-top: 1px solid #edf0f4;

    padding-top: 16px;
}


.log-panel summary {
    cursor: pointer;

    color: #7e8795;

    font-size: 12px;
}


.log-panel pre {
    max-height: 260px;

    overflow: auto;

    margin: 12px 0 0;

    padding: 14px;

    border-radius: 8px;

    background: #f5f6f8;

    color: #697383;

    font-family:
        Consolas,
        "Courier New",
        monospace;

    font-size: 11px;

    line-height: 1.6;

    white-space: pre-wrap;

    word-break: break-word;
}


/* =========================================================
   FFMPEG ALERT
========================================================= */

.ffmpeg-alert {
    margin-top: 12px;

    padding: 11px;

    border-radius: 8px;

    background: #fff6f6;

    color: #c04444;

    font-size: 12px;

    line-height: 1.5;
}


/* =========================================================
   TOAST
========================================================= */

.toast {
    position: fixed;

    left: 50%;

    bottom: 28px;

    transform:
        translate(-50%, 20px);

    padding: 11px 18px;

    border-radius: 8px;

    background: #172033;

    color: #fff;

    font-size: 13px;

    opacity: 0;

    pointer-events: none;

    transition:
        opacity .2s,
        transform .2s;

    z-index: 9999;
}


.toast.show {
    opacity: 1;

    transform:
        translate(-50%, 0);
}


/* =========================================================
   UTILITY
========================================================= */

.hidden {
    display: none !important;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 900px) {

    .workspace {
        grid-template-columns:
            1fr;
    }

    .settings-card {
        order: 2;
    }

}


@media (max-width: 640px) {

    .page {
        width:
            calc(100% - 24px);

        padding-top: 22px;
    }


    .page-header {
        flex-direction: column;
    }


    .file-info {
        grid-template-columns:
            1fr;
    }


    .file-meta {
        grid-template-columns:
            1fr 1fr;
    }


    .main-card,
    .settings-card {
        padding: 16px;
    }


    .drop-zone {
        min-height: 320px;

        padding: 30px 20px;
    }


    .result-panel {
        align-items: flex-start;

        flex-wrap: wrap;
    }

}