/* ==========================================
   PDF結合・分割・圧縮ツール - Style
   ========================================== */

/* --- Base --- */
.subtitle {
    text-align: center;
    color: #64748b;
    font-size: 1.2rem;
    margin-bottom: 3rem;
}

.card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    margin-bottom: 2rem;
}

.card__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 0.5rem;
}

.card__description {
    color: #64748b;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.action-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #3b82f6;
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.action-button:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.action-button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.action-button__icon {
    width: 20px;
    height: 20px;
}

.action-bar {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

.action-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    margin-bottom: 2rem;
}

#relatedToolsContainer {
    margin-top: 3rem;
}

/* --- Tabs --- */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 0;
    background: white;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -2px 6px -1px rgb(0 0 0 / 0.05);
    overflow: hidden;
}

.tabs__button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
}

.tabs__button:hover {
    background: #e2e8f0;
    color: #334155;
}

.tabs__button--active {
    background: white;
    color: #3b82f6;
    border-bottom: 3px solid #3b82f6;
}

.tabs__icon {
    width: 20px;
    height: 20px;
}

/* --- Tab Content --- */
.tab-content {
    display: none;
    border-radius: 0 0 12px 12px;
    margin-top: 0;
}

.tab-content--active {
    display: block;
}

/* --- Dropzone --- */
.dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    background: #f8fafc;
}

.dropzone:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.dropzone--active {
    border-color: #3b82f6;
    background: #eff6ff;
    transform: scale(1.01);
}

.dropzone__icon {
    width: 48px;
    height: 48px;
    color: #94a3b8;
    margin: 0 auto 1rem;
}

.dropzone__text {
    font-size: 1.1rem;
    color: #475569;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.dropzone__subtext {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.dropzone__label {
    display: inline-block;
    background: #3b82f6;
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.dropzone__label:hover {
    background: #2563eb;
}

.dropzone__input {
    display: none;
}

/* --- File List (Merge) --- */
.file-list {
    margin-top: 1.5rem;
}

.file-list__item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: grab;
    transition: all 0.2s;
    user-select: none;
}

.file-list__item:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.file-list__item--dragging {
    opacity: 0.5;
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgb(59 130 246 / 0.2);
}

.file-list__item--dragover {
    border-color: #3b82f6;
    background: #dbeafe;
    transform: translateY(2px);
}

.file-list__grip {
    color: #94a3b8;
    font-size: 1.2rem;
    cursor: grab;
    flex-shrink: 0;
}

.file-list__icon {
    width: 24px;
    height: 24px;
    color: #ef4444;
    flex-shrink: 0;
}

.file-list__name {
    flex: 1;
    font-weight: 500;
    color: #334155;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-list__size {
    color: #64748b;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.file-list__pages {
    color: #3b82f6;
    font-size: 0.85rem;
    font-weight: 500;
    flex-shrink: 0;
}

.file-list__remove {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
    line-height: 1;
}

.file-list__remove:hover {
    color: #ef4444;
    background: #fef2f2;
}

/* --- Split Info --- */
.split-info {
    margin-top: 1.5rem;
}

.split-info__file {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.split-info__name {
    flex: 1;
    font-weight: 600;
    color: #166534;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.split-info__pages {
    color: #3b82f6;
    font-size: 0.85rem;
    font-weight: 500;
    flex-shrink: 0;
}

.split-info__size {
    color: #64748b;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.split-info__remove {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s;
    line-height: 1;
}

.split-info__remove:hover {
    color: #ef4444;
    background: #fef2f2;
}

/* --- Split Mode Selection --- */
.split-mode {
    margin-bottom: 1.5rem;
}

.split-mode__label {
    display: block;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.75rem;
}

.split-mode__options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.split-mode__option {
    cursor: pointer;
}

.split-mode__option input {
    display: none;
}

.split-mode__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s;
    text-align: center;
}

.split-mode__card:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}

.split-mode__option input:checked + .split-mode__card {
    border-color: #3b82f6;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1);
}

.split-mode__title {
    font-weight: 600;
    color: #334155;
    font-size: 0.95rem;
}

.split-mode__desc {
    color: #64748b;
    font-size: 0.8rem;
}

/* --- Split Options --- */
.split-options {
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.split-options__label {
    display: block;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.5rem;
}

.split-options__input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.split-options__input--short {
    width: 100px;
}

.split-options__input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1);
}

.split-options__n-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.split-options__n-suffix {
    color: #475569;
    font-weight: 500;
    font-size: 1rem;
}

.split-options__help {
    margin-top: 0.5rem;
    color: #94a3b8;
    font-size: 0.85rem;
}

/* --- Compress Info --- */
.compress-info {
    margin-top: 1.5rem;
}

.compress-info__file {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.compress-info__name {
    flex: 1;
    font-weight: 600;
    color: #166534;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compress-info__size {
    color: #64748b;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.compress-info__remove {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s;
    line-height: 1;
}

.compress-info__remove:hover {
    color: #ef4444;
    background: #fef2f2;
}

/* --- Compress Quality --- */
.compress-quality {
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
}

.compress-quality__label {
    display: block;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.75rem;
}

.compress-quality__options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.compress-quality__option {
    cursor: pointer;
}

.compress-quality__option input {
    display: none;
}

.compress-quality__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s;
    text-align: center;
}

.compress-quality__card:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}

.compress-quality__option input:checked + .compress-quality__card {
    border-color: #3b82f6;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1);
}

.compress-quality__title {
    font-weight: 600;
    color: #334155;
    font-size: 0.95rem;
}

.compress-quality__desc {
    color: #64748b;
    font-size: 0.8rem;
}

/* --- Compress Result --- */
.compress-result {
    margin-top: 1.5rem;
}

.compress-result__summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    flex-wrap: wrap;
}

.compress-result__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.compress-result__label {
    color: #64748b;
    font-size: 0.8rem;
}

.compress-result__value {
    font-weight: 700;
    font-size: 1.2rem;
    color: #334155;
}

.compress-result__value--highlight {
    color: #16a34a;
}

.compress-result__arrow {
    color: #94a3b8;
    font-size: 1.5rem;
    font-weight: 700;
}

/* --- Split Results --- */
.split-results {
    margin-top: 2rem;
    border-top: 2px solid #e2e8f0;
    padding-top: 1.5rem;
}

.split-results__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.split-results__title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #334155;
}

.split-results__download-all {
    font-size: 0.9rem;
    padding: 0.5rem 1.25rem;
}

.split-results__list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.split-result-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s;
}

.split-result-item:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}

.split-result-item__icon {
    width: 28px;
    height: 28px;
    color: #ef4444;
    flex-shrink: 0;
}

.split-result-item__name {
    flex: 1;
    font-weight: 500;
    color: #334155;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.split-result-item__pages {
    color: #3b82f6;
    font-size: 0.85rem;
    font-weight: 500;
    flex-shrink: 0;
}

.split-result-item__size {
    color: #64748b;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.split-result-item__download {
    background: #10b981;
    color: white;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.split-result-item__download:hover {
    background: #059669;
}

.split-result-item__download-icon {
    width: 14px;
    height: 14px;
}

/* --- Progress Bar --- */
.progress-container {
    margin-top: 1.5rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-bar__text {
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .card {
        padding: 1.5rem;
    }

    .tabs__button {
        padding: 0.75rem 0.5rem;
        font-size: 0.9rem;
    }

    .tabs__icon {
        width: 16px;
        height: 16px;
    }

    .dropzone {
        padding: 2rem 1rem;
    }

    .dropzone__icon {
        width: 36px;
        height: 36px;
    }

    .split-results__header {
        flex-direction: column;
        align-items: stretch;
    }

    .split-results__download-all {
        width: 100%;
        justify-content: center;
    }

    .split-result-item {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .split-result-item__name {
        flex-basis: calc(100% - 44px);
    }

    .split-result-item__download {
        width: 100%;
        justify-content: center;
    }

    .file-list__item {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .file-list__name {
        min-width: 0;
        flex-basis: calc(100% - 80px);
    }

    .split-info__file {
        flex-wrap: wrap;
    }

    .compress-info__file {
        flex-wrap: wrap;
    }

    .split-mode__options {
        grid-template-columns: 1fr;
    }

    .compress-quality__options {
        grid-template-columns: 1fr;
    }

    .compress-result__summary {
        flex-direction: column;
        gap: 1rem;
    }

    .compress-result__arrow {
        transform: rotate(90deg);
    }

    .action-button {
        width: 100%;
        justify-content: center;
    }

    .subtitle {
        font-size: 1rem;
    }
}
