/* PDF結合・分割ツール - スタイル */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #0a0b10;
    color: #e0e0e8;
    min-height: 100vh;
}

#app {
    max-width: 720px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

/* ヘッダー */
.tool-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.tool-title {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #f97316, #ef4444, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.tool-subtitle {
    color: #6b6f80;
    font-size: 0.85rem;
}

/* タブ */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    background: rgba(30, 32, 48, 0.6);
    border-radius: 12px;
    padding: 4px;
    border: 1px solid rgba(249, 115, 22, 0.1);
}

.tab {
    flex: 1;
    background: transparent;
    border: none;
    border-radius: 9px;
    padding: 0.65rem 1rem;
    color: #6b6f80;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
}

.tab:hover {
    color: #a0a4b8;
}

.tab.active {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.2), rgba(239, 68, 68, 0.12));
    color: #e0e0e8;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.12);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ドロップゾーン */
.drop-zone {
    border: 2px dashed rgba(249, 115, 22, 0.3);
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    background: rgba(30, 32, 48, 0.4);
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: #f97316;
    background: rgba(249, 115, 22, 0.06);
    box-shadow: 0 0 30px rgba(249, 115, 22, 0.08);
}

.drop-zone.drag-over {
    transform: scale(1.01);
}

.drop-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.drop-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #a0a4b8;
    margin-bottom: 0.5rem;
}

.drop-sub {
    color: #6b6f80;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.file-label {
    color: #f97316;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s;
}

.file-label:hover {
    color: #fb923c;
}

.drop-hint {
    color: #4a4d5e;
    font-size: 0.75rem;
}

/* ファイルリスト */
.file-list {
    margin: 1.5rem 0;
}

.file-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.file-count {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fb923c;
}

.total-size {
    font-size: 0.78rem;
    color: #6b6f80;
}

.file-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(30, 32, 48, 0.6);
    border: 1px solid rgba(249, 115, 22, 0.1);
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    transition: all 0.2s;
    cursor: grab;
    -webkit-user-select: none;
    user-select: none;
}

.file-item:hover {
    border-color: rgba(249, 115, 22, 0.25);
}

.file-item.dragging {
    opacity: 0.4;
    border-color: #f97316;
}

.file-item.drag-over-item {
    border-color: #f97316;
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.2);
}

.file-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #e0e0e8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-meta {
    font-size: 0.72rem;
    color: #6b6f80;
    margin-top: 0.15rem;
}

.file-order {
    font-size: 0.75rem;
    font-weight: 700;
    color: #f97316;
    background: rgba(249, 115, 22, 0.1);
    border-radius: 6px;
    padding: 0.15rem 0.5rem;
    flex-shrink: 0;
}

.file-remove {
    background: none;
    border: none;
    color: #4a4d5e;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s;
    flex-shrink: 0;
}

.file-remove:hover {
    color: #f87171;
}

.reorder-hint {
    text-align: center;
    font-size: 0.72rem;
    color: #4a4d5e;
    margin-top: 0.5rem;
}

/* アクション */
.merge-actions,
.split-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.25rem;
}

/* 設定パネル */
.settings-panel {
    background: rgba(30, 32, 48, 0.8);
    border: 1px solid rgba(249, 115, 22, 0.15);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.setting-group label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #8b8fa0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.setting-group select,
.text-input {
    background: #12131a;
    border: 1px solid rgba(249, 115, 22, 0.2);
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    color: #e0e0e8;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.setting-group select:focus,
.text-input:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.input-hint {
    font-size: 0.7rem;
    color: #4a4d5e;
}

.split-file-info {
    background: rgba(30, 32, 48, 0.6);
    border: 1px solid rgba(249, 115, 22, 0.1);
    border-radius: 10px;
    padding: 0.8rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.split-file-info .file-icon {
    font-size: 1.8rem;
}

/* ボタン */
.btn-primary {
    background: linear-gradient(135deg, #f97316, #ef4444);
    border: none;
    border-radius: 10px;
    padding: 0.65rem 1.25rem;
    color: white;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.4);
}

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

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

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 10px;
    padding: 0.65rem 1.25rem;
    color: #f87171;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.18);
}

.btn-download {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 8px;
    padding: 0.4rem 0.8rem;
    color: #4ade80;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-download:hover {
    background: rgba(34, 197, 94, 0.2);
}

/* 結果セクション */
.result-section {
    background: rgba(30, 32, 48, 0.8);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 12px;
    padding: 1.25rem;
    margin: 1.5rem 0;
    text-align: center;
}

.result-label {
    font-size: 1rem;
    font-weight: 700;
    color: #4ade80;
    margin-bottom: 0.75rem;
}

.result-info {
    font-size: 0.85rem;
    color: #a0a4b8;
    margin-bottom: 1rem;
}

.result-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    text-align: left;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(30, 32, 48, 0.6);
    border: 1px solid rgba(34, 197, 94, 0.1);
    border-radius: 10px;
    padding: 0.5rem 0.8rem;
}

.result-item .file-info {
    flex: 1;
}

.result-item .file-name {
    font-size: 0.82rem;
}

.result-item .file-meta {
    font-size: 0.7rem;
}

/* フッター */
.tool-footer {
    text-align: center;
    padding: 2rem 0 1rem;
    border-top: 1px solid rgba(249, 115, 22, 0.1);
    margin-top: 2rem;
}

.tool-footer p {
    color: #4a4d5e;
    font-size: 0.78rem;
    margin-bottom: 0.4rem;
}

.footer-link a {
    color: #f97316;
    text-decoration: none;
}

.footer-link a:hover {
    color: #fb923c;
}

/* プログレス */
.progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 11, 16, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.progress-content {
    text-align: center;
}

.progress-spinner {
    font-size: 2.5rem;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

.progress-text {
    font-size: 0.9rem;
    color: #a0a4b8;
}

/* 非表示ユーティリティ */
.hidden {
    display: none !important;
}

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

    .drop-zone {
        padding: 2rem 1rem;
    }

    .drop-icon {
        font-size: 2.5rem;
    }

    .merge-actions,
    .split-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .file-item {
        flex-wrap: wrap;
    }
}
