/* ============================================
   Image Renamer Pro - Web版 スタイルシート
   ============================================ */

/* リセット & ベーススタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #E96A30;
    --secondary-color: #10b981;
    --accent-color: #001BF9;
    --danger-color: #ef4444;
    --success-color: #22c55e;
    --surface-color: #ffffff;
    --background-color: #f8fafc;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "SF Pro Display", 
                 "Hiragino Sans", "ヒラギノ角ゴ ProN W3", sans-serif;
    background: linear-gradient(135deg, #E96A30 0%, #ff9966 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

/* コンテナ */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

/* ヘッダー */
.header {
    background: var(--surface-color);
    padding: 30px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 10px;
    font-weight: 800;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* メインコンテンツ */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

/* 上部行：ステップ1と2を横並び */
.top-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* 中央行：ステップ3と画像プレビューを横並び */
.middle-row {
    display: grid;
    grid-template-columns: 500px 1fr;
    gap: 20px;
}

/* 下部行：処理済みリスト */
.bottom-row {
    width: 100%;
}

@media (max-width: 1200px) {
    .top-row {
        grid-template-columns: 1fr;
    }
    
    .middle-row {
        grid-template-columns: 1fr;
    }
}

/* セクション */
.section {
    background: var(--surface-color);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

/* コンパクトセクション（ステップ1・2用） */
.compact-section {
    padding: 20px;
}

.compact-section h2 {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.section-note {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-style: italic;
}

/* 画像プレビューセクション */
.image-preview-section {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.image-preview-section .image-preview-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.section h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--text-primary);
    font-weight: 700;
}

.section h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-primary);
    font-weight: 600;
}

/* ファイルアップロード */
.file-upload-area {
    margin-bottom: 15px;
}

.file-upload-area.compact {
    margin-bottom: 10px;
}

.file-input {
    display: none;
}

.file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    border: 3px dashed var(--border-color);
    border-radius: 12px;
    background: var(--background-color);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

/* コンパクトラベル（ステップ1・2用） */
.file-label.compact-label {
    padding: 25px 15px;
}

.file-label:hover {
    border-color: var(--primary-color);
    background: #fff4ed;
    transform: translateY(-2px);
}

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

.upload-icon.small {
    font-size: 2rem;
    margin-bottom: 8px;
}

.file-label span:last-child {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ステータスメッセージ */
.status-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
}

.status-message.success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--success-color);
}

.status-message.error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--danger-color);
}

.status-message.info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid var(--primary-color);
}

/* フォームグループ */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--background-color);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--surface-color);
    box-shadow: 0 0 0 3px rgba(233, 106, 48, 0.1);
}

.form-control:disabled {
    background: #f3f4f6;
    cursor: not-allowed;
    opacity: 0.6;
}

/* ボタングループ */
.button-group {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 15px;
    margin-bottom: 25px;
}

/* ボタン */
.btn {
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: var(--shadow);
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

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

.btn-primary:hover:not(:disabled) {
    background: #d45a20;
}

.btn-secondary {
    background: var(--text-secondary);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #4b5563;
}

.btn-success {
    background: var(--primary-color);
    color: white;
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
}

.btn-success:hover:not(:disabled) {
    background: #d45a20;
}

/* プレビューセクション */
.preview-section {
    background: var(--background-color);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.filename-preview {
    padding: 15px;
    background: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--accent-color);
    word-break: break-all;
    min-height: 50px;
    display: flex;
    align-items: center;
}

/* ダウンロードセクション */
.download-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid var(--border-color);
}

/* 画像プレビュー */
.image-preview-container {
    position: relative;
}

.image-preview {
    width: 100%;
    height: 600px;
    background: var(--background-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid var(--border-color);
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.placeholder {
    text-align: center;
    color: var(--text-secondary);
}

.placeholder-icon {
    font-size: 5rem;
    display: block;
    margin-bottom: 15px;
    opacity: 0.5;
}

.placeholder p {
    font-size: 1.1rem;
    line-height: 1.8;
}

/* 画像情報 */
.image-info {
    margin-top: 15px;
    padding: 12px;
    background: var(--background-color);
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-align: center;
    font-weight: 600;
}

/* 処理済みリスト */
.processed-list {
    max-height: 300px;
    overflow-y: auto;
    background: var(--background-color);
    padding: 15px;
    border-radius: 8px;
}

.processed-list::-webkit-scrollbar {
    width: 8px;
}

.processed-list::-webkit-scrollbar-track {
    background: var(--border-color);
    border-radius: 4px;
}

.processed-list::-webkit-scrollbar-thumb {
    background: var(--text-secondary);
    border-radius: 4px;
}

.processed-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-primary);
}

.placeholder-text {
    color: var(--text-secondary);
    text-align: center;
    padding: 20px;
}

.processed-item {
    padding: 10px;
    margin-bottom: 8px;
    background: var(--surface-color);
    border-radius: 6px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.processed-item::before {
    content: "✓";
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.2rem;
}

/* フッター */
.footer {
    background: var(--surface-color);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    box-shadow: var(--shadow);
}

/* アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section {
    animation: fadeIn 0.5s ease;
}

/* 入力セクション表示アニメーション */
.input-section {
    animation: fadeIn 0.6s ease;
}

/* レスポンシブ調整 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8rem;
    }

    .button-group {
        grid-template-columns: 1fr;
    }

    .image-preview {
        height: 300px;
    }

    .section {
        padding: 20px;
    }
    
    .compact-section {
        padding: 15px;
    }
}

/* ローディングスピナー */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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