.audio-merger-container {
    max-width: 750px;
    margin: 0 auto 50px;
    padding: 15px 10px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.audio-merger-title {
    text-align: center;
    margin-bottom: 15px;
    margin-top: 0;
    font-size: 28px;
    color: #2c3e50;
}

.progress-view {
    padding: 20px 0;
}

.progress-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.progress-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #f0f0f0;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 15px;
}

.progress-container {
    flex-grow: 1;
    height: 20px;
    background-color: #ecf0f1;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-inner {
    height: 100%;
    width: 0%;
    background-color: #3498db;
    transition: width 0.2s ease-in-out;
    border-radius: 10px;
}

.progress-percentage-text {
    font-weight: 500;
    margin-left: 15px;
    color: #2c3e50;
}

.upload-section {
    border: 2px dashed #adb5bd;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    margin: 0 auto 25px;
    background: #f8f9fa;
    transition: all 0.3s;
    cursor: pointer;
    max-width: 450px;
}

.upload-section:hover {
    border-color: #2a73d9;
    background: #f1f3ff;
}

.upload-section.drag-over {
    border-color: #2a73d9;
    background: #e9ecef;
}

.upload-icon {
    color: #3498db;
    margin-bottom: 10px;
    line-height: 1;
}

.drop-text {
    font-size: 17px;
    margin-bottom: 0;
    margin-top: 10px;
    font-weight: 500;
}

.drop-or {
    margin-bottom: 15px;
    margin-top: 5px;
    font-size: 16px;
}

.upload-section p {
    text-align: center;
}

.upload-btn {
    padding: 9px 13px;
    background-color: #277bb2;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.upload-btn:hover,
.upload-btn:focus {
    background-color: #277bb2;
    color: white;
    box-shadow: none;
    outline: none;
}

.upload-btn:active {
    background-color: #277bb2;
    transform: scale(0.98);
}

.file-input {
    display: none;
}

.sort-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.sort-control,
.format-control,
.quality-control {
    display: flex;
    align-items: center;
    gap: 5px;
}

.quality-control {
    /* Initially hidden, shown via JS */
    display: none;
}

.sort-label {
    font-weight: 500;
    color: #495057;
    font-size: 17px;
}

.sort-select {
    padding: 9px 12px;
    border-radius: 5px;
    border: 1px solid #ced4da;
    font-size: 16px;
    background: #fff;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 8L10 12L14 8' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 18px 18px;
    padding-right: 40px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.audio-merger-container .sort-select:focus,
.audio-merger-container .format-select:focus {
    outline: none;
    border-color: #2a73d9;
    box-shadow: 0 0 0 1px rgba(42, 115, 217, 0.2);
    background-color: white;
}

.file-list-container {
    margin-bottom: 25px;
    margin-top: 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.file-list {
    list-style-type: none;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px;
    margin-top: 0;
    margin-bottom: 0;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 0;
}

.file-item.is-playing {
    flex-wrap: wrap;
}

.file-list .file-item.dragging {
    opacity: 0.5;
    background: #f8f9fa;
    cursor: move;
}

.file-list .file-item {
    cursor: grab;
}

.file-item:last-child {
    border-bottom: none;
}

.reorder-control {
    margin-right: 10px;
}

.audio-merger-container .reorder-input {
    width: 40px;
    padding: 6px;
    text-align: center;
    background-color: #fff;
    border: 1px solid #d1d5db;
    font-size: 14px;
    border-radius: 4px;
    -moz-appearance: textfield;
    appearance: textfield;
}

.audio-merger-container .reorder-input:focus {
    outline: none;
    border-color: #2a73d9;
    box-shadow: 0 0 0 1px rgba(42, 115, 217, 0.2);
    background-color: white;
}

.audio-merger-container .reorder-input:hover {
    background-color: white;
}

/* Hide spinners from number input */
.reorder-input::-webkit-outer-spin-button,
.reorder-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.file-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* Prevents flex item from overflowing */
    align-items: flex-start;
    gap: 4px;
    flex: 1;
}

.file-name {
    font-weight: 500;
    color: #2c3e50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    max-width: 100%;
    /* Ensure it respects the container width */
}

.file-duration {
    color: #525a5b;
    font-size: 0.9rem;
}

.file-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-size {
    color: #525a5b;
    font-size: 0.9rem;
    border-left: 1px solid #ccc;
    padding-left: 12px;
}

.file-bitrate {
    color: #525a5b;
    font-size: 0.9rem;
    border-left: 1px solid #ccc;
    padding-left: 12px;
}

.play-link {
    color: #135989;
    font-size: 0.9rem;
    cursor: pointer;
    border-left: 1px solid #ccc;
    padding-left: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.file-controls {
    display: flex;
    gap: 10px;
}

.audio-merger-container .control-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: #525a5b;
    transition: color 0.3s;
}

.play-btn:hover {
    color: #2ecc71;
}

.delete-btn:hover {
    color: #e74c3c;
}

.merge-section {
    margin-bottom: 25px;
    margin-top: 0;
}

.merge-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.merge-btn {
    padding: 9px 13px;
    background-color: #0f8742;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
    font-size: 1rem;
}

.merge-btn .am-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    margin-left: 10px;
}

.merge-btn.is-merging .am-spinner {
    display: inline-block;
    animation: spin 1s linear infinite;
}

.merge-btn:hover,
.merge-btn:focus {
    background-color: #0f8742;
    color: white;
    box-shadow: none;
    outline: none;
}

.merge-btn:active {
    background-color: #0f8742;
    transform: scale(0.98);
}

.merge-btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

.download-btn {
    padding: 9px 13px;
    background-color: #277bb2;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.download-btn:hover,
.download-btn:focus {
    background-color: #277bb2;
    color: white;
    box-shadow: none;
    outline: none;
}

.download-btn:active {
    background-color: #277bb2;
    transform: scale(0.98);
}

.download-btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

.btn-loader {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.download-btn.is-downloading .btn-loader {
    display: inline-block;
}

.clear-btn {
    padding: 9px 13px;
    background-color: #c0392b;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
    font-size: 1rem;
}

.clear-btn:hover,
.clear-btn:focus {
    background-color: #c0392b;
    color: white;
    box-shadow: none;
    outline: none;
}

.clear-btn:active {
    background-color: #c0392b;
    transform: scale(0.98);
}

.audio-player {
    width: 100%;
    margin-top: 10px;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.format-select {
    padding: 9px 13px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    background-color: white;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 8L10 12L14 8' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 18px 18px;
    padding-right: 40px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.audio-merger-container .sort-select:hover,
.audio-merger-container .format-select:hover {
    background-color: white;
}

.result-view {
    text-align: center;
    padding: 20px;
}

.success-icon {
    width: 50px;
    height: 50px;
    color: #0f8742;
    margin-bottom: 0;
}

.result-message {
    font-size: 1.2rem;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 15px;
    text-align: center;
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.back-btn {
    padding: 9px 13px;
    background-color: #697778;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
    font-size: 1rem;
}

.back-btn:hover,
.back-btn:focus {
    background-color: #697778;
    color: white;
    box-shadow: none;
    outline: none;
}

.back-btn:active {
    background-color: #697778;
    transform: scale(0.98);
}

.animated-loading-text {
    text-align: center;
    font-size: 17px;
    color: #5a6a7a;
    height: 20px;
    margin-top: 10px;
}

.empty-state {
    text-align: center;
    padding: 30px;
    color: #525a5b;
}

.drag-over {
    background-color: #e8f4fc;
    border: 2px dashed #3498db;
}

.am-hidden {
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.faq-list {
    margin-top: 1rem;
}

.faq-list dt {
    font-weight: 500;
    font-size: 1.1em;
}

.faq-list dd {
    margin-left: 0;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    padding-left: 1rem;
    padding-bottom: 10px;
    border-bottom: 1px dashed #ddd;
}

@media (max-width: 768px) {
    .audio-merger-container {
        margin-bottom: 60px;
        padding: 20px 0;
        border-radius: 0;
        box-shadow: none;
        border-top: 1px solid #e9e9e9;
        border-bottom: 1px solid #e9e9e9;
    }

    .sort-bar {
        justify-content: flex-start;
    }

    .format-control {
        margin-left: 0;
    }

    .quality-control {
        margin-left: 0;
    }

    .upload-section {
        max-width: none;
        margin-left: 0;
        margin-right: 0;
    }

    .merge-controls {
        padding: 0 20px;
    }

    .file-list {
        border-bottom: 1px solid #e0e0e0;
        border-top: 1px solid #e0e0e0;
        border-left: none;
        border-right: none;
        border-radius: 0;
        padding-left: 0;
        padding-right: 0;
    }

    .file-list-container {
        max-width: none;
    }

    .file-item {
        flex-wrap: wrap;
        padding: 12px 0;
    }

    .result-view {
        padding: 20px 0;
    }

    ul#file-list {
        margin: 0;
    }

    .audio-merger-container .control-btn {
        padding: 0 0 0 5px;
    }
}