/* Video Creator専用スタイル */

.video-creator-main {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.page-description {
    font-size: 1.1rem;
    color: #a0a0a0;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* セクション共通スタイル */
section {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.section-heading {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(102, 126, 234, 0.3);
}

.subsection-heading {
    font-size: 1.2rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 1rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

/* フォーム要素 */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #e0e0e0;
    margin-bottom: 0.5rem;
}

.form-hint {
    display: block;
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.3rem;
}

.form-input,
.form-textarea,
.form-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: #ffffff;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-textarea {
    resize: vertical;
    font-family: inherit;
}

.form-select {
    cursor: pointer;
}

.form-select option {
    background: #1a1a2e;
    color: #ffffff;
    padding: 0.5rem;
}

/* テーブル */
.words-table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.5rem;
}

.words-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.02);
}

.table-header {
    background: rgba(102, 126, 234, 0.2);
    color: #ffffff;
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid rgba(102, 126, 234, 0.3);
}

.word-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background-color 0.2s ease;
}

.word-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.word-row td {
    padding: 0.75rem 1rem;
}

.row-number {
    color: #a0a0a0;
    font-weight: 500;
    text-align: center;
}

.table-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    color: #ffffff;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    resize: vertical;
    font-family: inherit;
    min-height: 2.5rem;
    line-height: 1.4;
}

.table-input:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

/* ボタン */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-youtube {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    margin-top: 1.5rem;
}

.btn-youtube:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.button-group .btn-youtube {
    margin-top: 0;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-large {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.btn-icon {
    width: 20px;
    height: 20px;
}

.btn-icon-small {
    background: transparent;
    border: none;
    color: #ff6b6b;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-small:hover {
    background: rgba(255, 107, 107, 0.1);
    transform: scale(1.1);
}

.btn-icon-small svg {
    width: 18px;
    height: 18px;
}

/* インポートセクション */
.import-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.import-description {
    color: #a0a0a0;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.import-description code {
    background: rgba(102, 126, 234, 0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #667eea;
}

.import-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.import-input-group .btn {
    align-self: flex-start;
}

/* アクションセクション */
.action-section {
    text-align: center;
    padding: 3rem 2rem;
}

.action-note {
    margin-top: 1rem;
    color: #a0a0a0;
    font-size: 0.9rem;
}

/* 保存済み動画セクション */
.saved-videos-content {
    margin-top: 1.5rem;
}

.saved-videos-description {
    color: #a0a0a0;
    margin-top: 1rem;
    margin-bottom: 0;
    line-height: 1.6;
    text-align: center;
}

.saved-videos-list {
    margin-bottom: 1.5rem;
}

.saved-videos-empty {
    color: #a0a0a0;
    text-align: center;
    padding: 2rem;
}

.saved-video-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.saved-video-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
}

.saved-video-item.selected {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.15);
}

.saved-video-radio {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.saved-video-item.selected .saved-video-radio {
    border-color: #667eea;
    background: #667eea;
}

.saved-video-item.selected .saved-video-radio::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffffff;
}

.saved-video-title {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 500;
}

.saved-videos-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.saved-upload-result {
    margin-top: 1.5rem;
    padding: 1.25rem;
    border-radius: 10px;
    text-align: center;
}

.saved-upload-result.success {
    background: rgba(81, 207, 102, 0.1);
    border: 1px solid rgba(81, 207, 102, 0.3);
    color: #51cf66;
}

.saved-upload-result.error {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: #ff6b6b;
}

.saved-upload-result.uploading {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: #667eea;
}

/* 進捗セクション */
.progress-section {
    background: rgba(255, 255, 255, 0.05);
}

.progress-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.progress-step {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.progress-step.active {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.progress-step.completed {
    border-color: #51cf66;
    background: rgba(81, 207, 102, 0.1);
}

.progress-step.error {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

.step-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(102, 126, 234, 0.2);
    border-radius: 50%;
    flex-shrink: 0;
}

.progress-step.completed .step-icon {
    background: rgba(81, 207, 102, 0.2);
}

.progress-step.error .step-icon {
    background: rgba(255, 107, 107, 0.2);
}

.step-icon svg {
    width: 24px;
    height: 24px;
    color: #667eea;
}

.progress-step.completed .step-icon svg {
    color: #51cf66;
}

.progress-step.error .step-icon svg {
    color: #ff6b6b;
}

.step-content {
    flex: 1;
}

.step-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.step-description {
    color: #a0a0a0;
    font-size: 0.95rem;
}

/* ステップ番号（待機中に表示） */
.step-number {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: #a0a0a0;
}

/* スピナー */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 結果セクション */
.result-section,
.error-section {
    margin-top: 2rem;
}

.result-success,
.result-error,
.result-warning {
    text-align: center;
    padding: 3rem 2rem;
    border-radius: 12px;
}

.result-success {
    background: rgba(81, 207, 102, 0.1);
    border: 1px solid rgba(81, 207, 102, 0.3);
}

.result-error {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.result-warning {
    background: rgba(255, 212, 59, 0.1);
    border: 1px solid rgba(255, 212, 59, 0.3);
}

.result-warning .result-icon {
    color: #ffd43b;
}

.youtube-limit-section {
    margin-top: 2rem;
}

.result-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
}

.result-success .result-icon {
    color: #51cf66;
}

.result-error .result-icon {
    color: #ff6b6b;
}

.result-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 1rem;
}

.result-description {
    color: #a0a0a0;
    margin-bottom: 2rem;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .page-title {
        font-size: 2rem;
    }

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

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    /* スマートフォンではテーブルをカード形式に */
    .words-table-container {
        border: none;
    }

    .words-table,
    .words-table thead,
    .words-table tbody,
    .words-table tr,
    .words-table td {
        display: block;
    }

    .words-table thead {
        display: none;
    }

    .word-row {
        margin-bottom: 1.5rem;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 12px;
        padding: 1rem;
        background: rgba(255, 255, 255, 0.02);
    }

    .word-row td {
        padding: 0.5rem 0;
        border: none;
    }

    .row-number {
        text-align: left;
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
        opacity: 0.7;
    }

    .row-number::before {
        content: '#';
    }

    .word-row td:nth-child(2)::before {
        content: '単語';
        display: block;
        color: #a0a0a0;
        font-size: 0.85rem;
        margin-bottom: 0.3rem;
        font-weight: 500;
    }

    .word-row td:nth-child(3)::before {
        content: '意味';
        display: block;
        color: #a0a0a0;
        font-size: 0.85rem;
        margin-bottom: 0.3rem;
        font-weight: 500;
    }

    .word-row td:nth-child(2),
    .word-row td:nth-child(3) {
        margin-bottom: 1rem;
    }

    .word-row td:last-child {
        text-align: center;
        margin-top: 0.5rem;
    }

    .table-input {
        font-size: 1rem;
        min-height: 4rem;
    }

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