/* Papa cut アプリケーション用スタイル */

/* メインタイトル */
.main-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    font-family: Helvetica, Arial, sans-serif;
    margin: 20px 0;
    text-align: center;
}

/* アプリコンテンツ全体のレイアウト */
.app-content {
    display: flex;
    flex-direction: row;
    gap: 48px;
    margin-bottom: 30px;
    justify-content: center;
}

/* アップロードセクション */
.upload-section {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 400px;
}

/* ドラッグ＆ドロップエリア */
.drop-area {
    width: 400px;
    height: 200px;
    border: 2px solid #000;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s;
}

.drop-area:hover {
    background-color: #f5f5f5;
}

.drop-area.active {
    background-color: #e0f7fa;
    border-color: #00acc1;
}

.drop-area p {
    margin-top: 10px;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 24px;
    color: #000000;
}

/* ファイル情報表示エリア */
.file-info {
    width: 400px;
    height: 100px;
    border: 2px solid #000;
    border-radius: 10px;
    padding: 10px;
    position: relative;
    box-sizing: border-box;
}

.file-label {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 16px;
    color: #000000;
    margin: 0;
    position: absolute;
    top: 10px;
    left: 10px;
}

.file-name {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 24px;
    color: #000000;
    margin: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 設定セクション */
.settings-section {
    width: 738px;
    display: flex;
    flex-direction: column;
}

/* カット間隔設定 */
.cut-interval {
    width: 738px;
    height: 318px;
    border: 2px solid #000;
    border-radius: 10px;
    padding: 20px;
    position: relative;
    box-sizing: border-box;
}

.section-title {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 16px;
    color: #000000;
    text-align: center;
    margin-top: 0;
    margin-bottom: 40px;
}

/* スライダー関連 */
.interval-slider-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 50px;
}

.slider-min, .slider-max {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 16px;
    color: #000000;
}

.interval-slider {
    width: 500px;
    height: 10px;
    background-color: #ddd;
    position: relative;
    border-radius: 5px;
}

.slider-track {
    height: 100%;
    background-color: #ddd;
    border-radius: 5px;
}

.slider-thumb {
    width: 24px;
    height: 24px;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 2;
    left: 50%; /* デフォルト位置 */
}

.interval-display {
    width: 200px;
    height: 100px;
    border: 2px solid #000;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px auto;
}

.interval-display p {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 24px;
    color: #000000;
    margin: 0;
}

/* プレビューセクション */
.preview-section {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    align-items: flex-start;
}

/* ローディング表示 */
.loading-container {
    display: none; /* 初期状態は非表示 */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 10%;
    min-width: 100px;
    margin-top: 35px; /* フレームラベル分の位置調整 */
}

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
}

.spinner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top-color: #000;
    animation: spin 1s infinite linear;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 18px;
    color: #000;
    margin: 0;
}

.preview-frame-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 45%;
}

.frame-label {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 24px;
    color: #000000;
    margin: 0 0 10px 0;
    font-weight: normal;
}

.preview-left, .preview-right {
    width: 260px;
    height: 150px;
    background-color: #f5f5f5;
    border: 2px solid #000;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.preview-left img, .preview-right img {
    max-width: 100%;
    max-height: 100%;
}

.range-info {
    text-align: center;
    margin-top: 10px;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 18px;
}

/* タイムラインセクション */
.timeline-section {
    margin-bottom: 30px;
}

.timeline-container {
    position: relative;
    width: 1186px;
    height: 100px;
    border: 2px solid #000;
    border-radius: 10px;
    margin-bottom: 10px;
}

.timeline {
    width: 100%;
    height: 100%;
    overflow-x: auto;
    white-space: nowrap;
    display: flex;
    align-items: center;
    position: relative;
}

.timeline img {
    height: 80px;
    margin-right: -65px; /* ネガティブマージンで2/3の重なりを実現 */
    border: 1px solid #333;
    box-sizing: border-box;
    transition: transform 0.2s, filter 0.2s;
    position: relative;
    filter: brightness(0.9);
}

.timeline img:hover {
    transform: translateY(-5px);
    filter: brightness(1.1);
    z-index: 5;
}

/* タイムラインの最後の画像にはマージンを適用しない */
.timeline img:last-child {
    margin-right: 0;
}

/* タイムラインマーカー */
.timeline-marker {
    position: absolute;
    width: 4px;
    height: 50px;
    background-color: #007bff;
    top: 50%;
    transform: translateY(-50%);
    cursor: col-resize;
    z-index: 10;
}

.timeline-marker.left {
    left: 5px;
    border-top-right-radius: 3px;
    border-bottom-right-radius: 3px;
}

.timeline-marker.right {
    right: 5px;
    border-top-left-radius: 3px;
    border-bottom-left-radius: 3px;
}

.timeline-range {
    position: absolute;
    height: 100%;
    background-color: rgba(0, 123, 255, 0.1);
    pointer-events: none;
    top: 0;
    z-index: 5;
}

/* ダウンロードセクション */
.download-section {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.download-button {
    width: 400px;
    height: 100px;
    border: 2px solid #000;
    border-radius: 10px;
    background-color: white;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 16px;
    color: #000000;
    cursor: pointer;
    transition: background-color 0.3s;
}

.download-button:hover {
    background-color: #f5f5f5;
}

.download-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* レスポンシブ対応 */
@media (max-width: 1200px) {
    .app-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .settings-section, .cut-interval {
        width: 100%;
        max-width: 738px;
    }
    
    .timeline {
        width: 100%;
        max-width: 1186px;
    }
}
