/* 音頻裁剪器樣式 */

.tool-container {
    max-width: 1000px;
    margin: 0 auto;
}

/* 上傳區域 */
.upload-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.upload-area {
    border: 3px dashed #ddd;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.upload-area h3 {
    color: #333;
}

.upload-area p {
    color: #333;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--bitcoin-orange);
    background: rgba(247, 147, 26, 0.05);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

#fileInput {
    display: none;
}

/* 編輯器區域 */
.editor-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    display: none;
}

.waveform-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

#waveform {
    width: 100%;
    height: 150px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: crosshair;
}

/* 控制項 */
.controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.control-group {
    flex: 1;
    min-width: 200px;
}

.control-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.control-group input {
    width: 100%;
    padding: 0.6rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
}

.control-group input:focus {
    outline: none;
    border-color: var(--bitcoin-orange);
}

/* 音頻播放器 */
.audio-player {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.play-btn {
    background: var(--bitcoin-orange);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.play-btn:hover {
    background: #e67e00;
    transform: scale(1.05);
}

.play-btn:active {
    transform: scale(0.95);
}

/* 自動去除靜音區域 */
.auto-trim-section {
    background: #f0f8ff;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 2px dashed #4a90e2;
}

.auto-trim-section h4 {
    margin: 0 0 1rem 0;
    color: #4a90e2;
    font-size: 1rem;
}

.silence-mode {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.mode-option {
    display: flex;
    flex-direction: column;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-option:hover {
    border-color: #4a90e2;
    background: rgba(74, 144, 226, 0.05);
}

.mode-option input[type="radio"] {
    display: none;
}

.mode-option input[type="radio"]:checked + .mode-label {
    color: #4a90e2;
    font-weight: 600;
}

.mode-option input[type="radio"]:checked ~ .mode-desc {
    color: #4a90e2;
}

.mode-option input[type="radio"]:checked {
    & ~ * {
        border-color: #4a90e2;
    }
}

.mode-option:has(input[type="radio"]:checked) {
    border-color: #4a90e2;
    background: rgba(74, 144, 226, 0.1);
}

.mode-label {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: #333;
}

.mode-desc {
    font-size: 0.85rem;
    color: #666;
}

.threshold-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.3rem;
}

.auto-trim-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.auto-trim-buttons .btn {
    flex: 1;
}

/* 操作按鈕 */
.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-green {
    background: #28a745;
    color: white;
    font-weight: bold;
}

.btn-green:hover {
    background: #218838;
}

/* 檔案資訊 */
.file-info {
    background: #e3f2fd;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.file-info p {
    margin: 0.3rem 0;
    color: #1976d2;
    font-size: 0.95rem;
}

/* 格式比較表格 */
.format-comparison {
    margin: 2rem 0;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.comparison-table th,
.comparison-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.comparison-table th {
    background: linear-gradient(135deg, var(--bitcoin-orange), var(--ethereum-blue));
    color: white;
    font-weight: 600;
}

.comparison-table tr:last-child td {
    border-bottom: none;
}

.comparison-table tr:hover {
    background: #f8f9fa;
}

/* 使用步驟 */
.tutorial-steps {
    display: grid;
    gap: 1.5rem;
}

.step {
    display: flex;
    gap: 1rem;
    align-items: start;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.step-number {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--bitcoin-orange), var(--ethereum-blue));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.step-content h4 {
    margin: 0 0 0.5rem 0;
    color: var(--bitcoin-orange);
}

.step-content p {
    margin: 0;
    color: #333;
    line-height: 1.6;
}

/* FAQ項目 */
.faq-item {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
}

.faq-item h4 {
    color: var(--bitcoin-orange);
    margin: 0 0 0.5rem 0;
}

.faq-item p {
    margin: 0;
    color: #333;
    line-height: 1.6;
}

/* 知識區塊 */
.knowledge-section {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
}

.knowledge-section h3 {
    color: var(--bitcoin-orange);
    margin-bottom: 1rem;
}

.knowledge-section ul {
    list-style: none;
    padding: 0;
}

.knowledge-section li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.knowledge-section li:before {
    content: "▶";
    position: absolute;
    left: 0;
    color: var(--bitcoin-orange);
}

/* 響應式設計 */
@media (max-width: 768px) {
    .controls {
        flex-direction: column;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn {
        width: 100%;
    }

    .comparison-table {
        font-size: 0.85rem;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 0.6rem;
    }

    .step {
        flex-direction: column;
        text-align: center;
    }

    .step-number {
        margin: 0 auto;
    }
}

/* 暗色模式支援 */
@media (prefers-color-scheme: dark) {
    .upload-section,
    .editor-section,
    .step,
    .faq-item {
        background: #2d2d2d;
    }

    .upload-area {
        background: #3d3d3d;
        border-color: #555;
    }

    .upload-area h3 {
        color: #fff;
    }

    .upload-area p {
        color: #ccc;
    }

    .waveform-container,
    .audio-player,
    .file-info {
        background: #3d3d3d;
    }

    .control-group label,
    .step-content h4,
    .faq-item h4 {
        color: #fff;
    }

    .step-content p {
        color: #e0e0e0;
    }

    .faq-item p {
        color: #e0e0e0;
    }

    .control-group input {
        background: #3d3d3d;
        border-color: #555;
        color: #fff;
    }

    .file-info p {
        color: #90caf9;
    }

    #waveform {
        background: #2d2d2d;
        border-color: #555;
    }

    .comparison-table {
        background: #2d2d2d;
    }

    .comparison-table td {
        border-color: #444;
        color: #e0e0e0;
    }

    .knowledge-section {
        background: #2d2d2d;
    }

    .knowledge-section h4 {
        color: #fff;
    }

    .knowledge-section p,
    .knowledge-section li {
        color: #e0e0e0;
    }

    .comparison-table tr:hover {
        background: #3d3d3d;
    }

    .auto-trim-section {
        background: #1a3a52;
        border-color: #4a90e2;
    }

    .auto-trim-section h4 {
        color: #6db3f2;
    }

    .threshold-labels {
        color: #ccc;
    }

    .auto-trim-buttons {
        flex-direction: column;
    }

    .auto-trim-buttons .btn {
        width: 100%;
    }

    .mode-option {
        border-color: #555;
        background: #2d2d2d;
    }

    .mode-option:hover {
        border-color: #6db3f2;
        background: rgba(109, 179, 242, 0.1);
    }

    .mode-option:has(input[type="radio"]:checked) {
        border-color: #6db3f2;
        background: rgba(109, 179, 242, 0.15);
    }

    .mode-option input[type="radio"]:checked + .mode-label {
        color: #6db3f2;
    }

    .mode-option input[type="radio"]:checked ~ .mode-desc {
        color: #90caf9;
    }

    .mode-label {
        color: #fff;
    }

    .mode-desc {
        color: #ccc;
    }
}
