/* components.css - コンポーネント固有のスタイル */

/* ============= アセットライブラリ ============= */

/* ドラッグ&ドロップエリア */
.drop-area {
    margin: 15px;
    padding: 20px;
    border: 2px dashed var(--border-color);
    border-radius: 6px;
    text-align: center;
    transition: all 0.3s;
}

.drop-area:hover {
    border-color: var(--primary-color);
    background-color: rgba(86, 101, 233, 0.05);
}

.drop-area i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.drop-area p {
    margin-bottom: 10px;
    font-weight: 500;
}

.file-upload-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 12px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 4px;
    cursor: pointer;
}

/* アセットコンテナ */
.asset-container,
.effects-container {
    padding: 15px;
    overflow-y: auto;
    flex: 1;
}

.asset-container.hidden,
.effects-container.hidden {
    display: none;
}

.asset-container h3,
.effects-container h3 {
    margin-bottom: 10px;
    font-size: 1rem;
}

/* アセットカテゴリ */
.asset-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 15px;
}

.category-btn {
    padding: 4px 8px;
    font-size: 0.8rem;
    border-radius: 20px;
    background-color: var(--light-bg);
}

.category-btn.active {
    background-color: var(--primary-color);
    color: white;
}

/* アセットグリッド */
.asset-grid,
.effects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

.asset-item,
.effect-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: grab;
}

.asset-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.asset-item span,
.effect-item span {
    font-size: 0.8rem;
    margin-top: 5px;
    text-align: center;
    word-break: break-word;
}

.video-thumbnail,
.audio-thumbnail,
.effect-preview {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--light-bg);
    border-radius: 4px;
}

.video-thumbnail i,
.audio-thumbnail i,
.effect-preview i {
    font-size: 2rem;
    color: var(--primary-color);
}

/* ============= プレビューエリア ============= */

/* プレビューエリア */
.preview-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.preview-screen {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
}

.preview-placeholder img {
    max-width: 100%;
    height: auto;
    display: block;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 再生コントロール */
.preview-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    justify-content: center;
}

.control-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.control-btn.play-btn {
    width: 46px;
    height: 46px;
    background-color: var(--primary-color);
    color: white;
}

.time-display {
    margin-left: 10px;
    font-size: 0.9rem;
}

/* シーンサムネイル */
.scene-thumbnails {
    display: flex;
    gap: 10px;
    padding: 15px 0;
    overflow-x: auto;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    margin-top: 15px;
}

.thumbnail {
    position: relative;
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
    border: 2px solid transparent;
    min-width: 120px;
}

.thumbnail.active {
    border-color: var(--primary-color);
}

.thumbnail img {
    width: 120px;
    height: 67px;
    object-fit: cover;
    display: block;
}

.thumbnail span {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 0.8rem;
    padding: 3px 5px;
    text-align: center;
}

/* ============= プロパティパネル ============= */

/* プロパティパネル */
#properties h3 {
    margin-bottom: 15px;
    font-size: 1rem;
}

.property-group {
    margin-bottom: 12px;
}

.property-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: #666;
}

.property-inputs {
    display: flex;
    gap: 10px;
}

.property-input {
    display: flex;
    align-items: center;
    gap: 5px;
}

.property-input input,
.property-group input[type="number"] {
    width: 60px;
    padding: 5px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.property-group input[type="range"] {
    width: 100%;
}

.range-value {
    margin-left: 10px;
    font-size: 0.9rem;
    color: #666;
}

/* ============= テキスト編集 ============= */

.text-properties {
    margin-top: 15px;
}

.text-properties select,
.text-properties input[type="number"] {
    width: 100%;
    padding: 6px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.text-style-buttons {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
}

.style-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--light-bg);
    border-radius: 4px;
}

.style-btn:hover {
    background-color: #e0e0e0;
}

/* ============= タイムライン ============= */

.editor-timeline {
    height: var(--timeline-height);
    background-color: white;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

/* タイムラインツールバー */
.timeline-toolbar {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
    gap: 10px;
}

.tool-btn {
    padding: 6px 10px;
    background-color: var(--light-bg);
    border-radius: 4px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tool-btn:hover {
    background-color: #e0e0e0;
}

.timeline-zoom {
    display: flex;
    align-items: center;
    margin-left: auto;
    gap: 5px;
}

.zoom-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--light-bg);
    border-radius: 4px;
}

/* タイムラインシーン */
.timeline-scenes {
    display: flex;
    padding-left: 120px;
    position: relative;
    height: 30px;
    border-bottom: 1px solid var(--border-color);
}

.scene-label {
    position: absolute;
    left: 0;
    top: 0;
    width: 120px;
    height: 100%;
    background-color: var(--light-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding-left: 15px;
    font-weight: 500;
    font-size: 0.9rem;
}

.scene-blocks {
    display: flex;
    height: 100%;
}

.scene-block {
    min-width: 100px;
    height: 100%;
    border-right: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    cursor: pointer;
}

.scene-block.active {
    background-color: rgba(86, 101, 233, 0.1);
    font-weight: 500;
    color: var(--primary-color);
}

/* タイムラインルーラー */
.timeline-ruler {
    height: 25px;
    border-bottom: 1px solid var(--border-color);
    padding-left: 120px;
    position: relative;
}

.ruler-ticks {
    display: flex;
    height: 100%;
}

.tick {
    width: 60px;
    display: flex;
    align-items: flex-end;
    padding-bottom: 3px;
    font-size: 0.8rem;
    color: #888;
    border-right: 1px solid var(--border-color);
}

/* トラック */
.timeline-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-x: auto;
    position: relative;
}

.timeline-tracks {
    flex: 1;
    position: relative;
}

.track {
    display: flex;
    height: var(--track-height);
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.track-label {
    position: absolute;
    left: 0;
    top: 0;
    width: 120px;
    height: 100%;
    background-color: var(--light-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding-left: 15px;
    font-size: 0.9rem;
}

.track-content {
    flex: 1;
    position: relative;
    padding-left: 120px;
    min-width: 100%;
}

/* クリップ */
.clip {
    position: absolute;
    height: 40px;
    top: 10px;
    border-radius: 4px;
    cursor: move;
    transition: box-shadow 0.2s ease, transform 0.1s ease;
}

.clip.selected {
    box-shadow: 0 0 0 2px #FFCC00, 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.video-clip {
    background-color: #6082BB;
    color: white;
}

.audio-clip {
    background-color: #60BB81;
    color: white;
}

.text-clip {
    background-color: #BB6060;
    color: white;
}

.clip-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 8px;
    font-size: 0.8rem;
    line-height: 40px;
}

/* ============= モーダル ============= */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1100;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.modal-header {
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.close-btn {
    font-size: 1.5rem;
    line-height: 1;
}

.modal-body {
    padding: 20px;
}

/* チュートリアル */
.tutorial-step {
    display: none;
}

.tutorial-step.active {
    display: block;
}

.tutorial-step img {
    max-width: 100%;
    margin: 15px 0;
    border-radius: 4px;
}

.tutorial-pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin: 15px 0;
}

.step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--border-color);
}

.step-dot.active {
    background-color: var(--primary-color);
}

.tutorial-nav {
    display: flex;
    justify-content: space-between;
}

.tutorial-btn {
    padding: 8px 15px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 4px;
}

.tutorial-btn:disabled {
    background-color: var(--border-color);
    cursor: not-allowed;
}

/* ============= レスポンシブ - コンポーネント固有 ============= */

@media screen and (max-width: 768px) {
    .editor-timeline {
        height: auto;
    }
    
    .timeline-toolbar {
        flex-wrap: wrap;
    }
    
    .timeline-zoom {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
        justify-content: center;
    }
    
    .tool-btn {
        font-size: 0.8rem;
    }
    
    .scene-thumbnails {
        justify-content: flex-start;
        padding: 10px;
    }
    
    .thumbnail {
        min-width: 100px;
    }
    
    .thumbnail img {
        width: 100px;
        height: 56px;
    }
}

@media screen and (max-width: 576px) {
    .asset-grid,
    .effects-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }
    
    .asset-item img,
    .video-thumbnail,
    .audio-thumbnail,
    .effect-preview {
        width: 60px;
        height: 60px;
    }
    
    .track-label {
        width: 80px;
    }
    
    .timeline-scenes,
    .timeline-ruler,
    .track-content {
        padding-left: 80px;
    }
    
    .scene-label {
        width: 80px;
    }
    
    .thumbnail {
        min-width: 80px;
    }
    
    .thumbnail img {
        width: 80px;
        height: 45px;
    }
}