/*
 * ZIP圧縮・解凍ツール (7017_zip-tool) 固有スタイル
 * 共通スタイルは ../7000_home/assets/css/common.css
 */

/* ===== モード切替タブ ===== */

.mode-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.mode-tab {
    flex: 1;
    padding: 1rem;
    font-size: 1.05rem;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-medium);
    background: var(--white);
    border: 2px solid var(--border-light);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.mode-tab i {
    margin-right: 0.5rem;
}

.mode-tab:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.mode-tab.is-active {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: var(--white);
}

/* ===== ドロップゾーン ===== */

.dropzone {
    border: 2px dashed var(--border-light);
    border-radius: 12px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    background: var(--bg-light);
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.dropzone:hover,
.dropzone:focus-visible {
    border-color: var(--primary-blue);
    background: rgba(41, 144, 208, 0.05);
}

.dropzone.is-over {
    border-color: var(--primary-blue);
    border-style: solid;
    background: rgba(41, 144, 208, 0.1);
}

.dropzone-icon {
    font-size: 2.5rem;
    color: var(--primary-blue);
    margin-bottom: 0.75rem;
}

.dropzone-lead {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.dropzone-sub {
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.dropzone-note {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-medium);
}

/* ===== 注記 ===== */

.notice-privacy p {
    font-size: 0.95rem;
}

/* ===== 暗号化ZIPの確認ステップ ===== */

.gate .gate-question {
    margin-top: 0.75rem;
    font-weight: 700;
    font-size: 1.05rem;
}

.gate-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.btn-secondary {
    background: var(--white);
    color: var(--text-dark);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: var(--bg-light);
}

.btn-warning {
    background: var(--warning-orange);
    color: var(--text-dark);
}

.btn-warning:hover {
    background: #e0a52f;
}

/* ===== パスワード ===== */

.pw-area {
    margin: 1.5rem 0;
    padding: 1.25rem;
    background: var(--bg-light);
    border-radius: 8px;
}

.pw-area > label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.pw-area > label i {
    color: var(--primary-blue);
    margin-right: 0.25rem;
}

.pw-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.pw-row input[type="password"],
.pw-row input[type="text"] {
    flex: 1;
    min-width: 12rem;
    padding: 0.7rem 0.9rem;
    font-size: 1rem;
    font-family: inherit;
    border: 1px solid var(--border-light);
    border-radius: 6px;
}

.pw-row input:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 1px;
}

.pw-note {
    margin-top: 0.6rem;
    font-size: 0.85rem;
    color: var(--text-medium);
}

/* ===== 文字コード切替 ===== */

.encoding-area {
    margin: 1.5rem 0;
}

.encoding-area fieldset {
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 1rem 1.25rem;
}

.encoding-area legend {
    font-weight: 500;
    padding: 0 0.5rem;
}

.encoding-area legend i {
    color: var(--primary-blue);
    margin-right: 0.25rem;
}

.radio-row {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.radio-row label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
}

.radio-row input:disabled + span,
.radio-row label:has(input:disabled) {
    color: var(--text-light);
    cursor: not-allowed;
}

.encoding-status {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-medium);
}

.encoding-status.is-warn {
    color: #b06d00;
    font-weight: 500;
}

.encoding-status.is-ok {
    color: var(--success-green);
}

/* ===== 一覧 ===== */

.list-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    flex-wrap: wrap;
}

.select-all {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
    cursor: pointer;
}

.list-summary {
    color: var(--text-medium);
    font-size: 0.9rem;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-blue);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.entry-list {
    border: 1px solid var(--border-light);
    border-radius: 8px;
    max-height: 26rem;
    overflow-y: auto;
}

.entry-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid var(--border-light);
}

.entry-row:last-child {
    border-bottom: none;
}

.entry-row:hover {
    background: var(--bg-light);
}

.entry-row.is-flagged {
    background: rgba(248, 183, 60, 0.08);
}

.entry-icon {
    color: var(--text-light);
    flex-shrink: 0;
}

.entry-main {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.entry-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    /* ZIP由来のファイル名で表示方向が変わらないようにする */
    unicode-bidi: plaintext;
}

.entry-lock {
    color: var(--warning-orange);
    flex-shrink: 0;
}

.flag {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    white-space: nowrap;
}

.flag-exec,
.flag-spoof {
    background: rgba(231, 76, 60, 0.12);
    color: #b03a2e;
}

.flag-macro {
    background: rgba(248, 183, 60, 0.2);
    color: #8a6100;
}

.entry-size,
.entry-date {
    color: var(--text-medium);
    font-size: 0.85rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.entry-size {
    width: 5rem;
    text-align: right;
}

.entry-date {
    width: 9rem;
    text-align: right;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--primary-blue);
    font-size: 1rem;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
}

.icon-btn:hover {
    background: rgba(41, 144, 208, 0.1);
}

/* ===== 操作 ===== */

.actions {
    margin-top: 1.5rem;
    text-align: center;
}

.actions .btn:disabled {
    background: var(--border-light);
    color: var(--text-light);
    cursor: not-allowed;
    transform: none;
}

.actions-note {
    margin-top: 0.6rem;
    font-size: 0.85rem;
    color: var(--text-medium);
}

/* ===== 圧縮オプション ===== */

.options {
    margin-top: 1.5rem;
    display: grid;
    gap: 1rem;
}

.option-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    border: none;
    padding: 0;
}

.option-row > label,
.option-row > legend {
    font-weight: 500;
    min-width: 8rem;
}

.filename-input {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.filename-input input {
    padding: 0.6rem 0.8rem;
    font-size: 1rem;
    font-family: inherit;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    min-width: 14rem;
}

.filename-input .ext {
    color: var(--text-medium);
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-weight: 400;
}

/* ===== 進捗 ===== */

.progress-card {
    position: sticky;
    bottom: 1rem;
}

.progress-label {
    font-weight: 500;
    margin-bottom: 0.6rem;
}

.progress-track {
    height: 0.9rem;
    background: var(--border-light);
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0;
    background: var(--primary-blue);
    border-radius: 999px;
    transition: width 0.2s;
}

.progress-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.6rem;
}

/* ===== FAQ ===== */

.faq h2 {
    font-size: 1.3rem;
    color: var(--primary-blue);
    margin-bottom: 1rem;
}

.faq h2 i {
    margin-right: 0.5rem;
}

.faq details {
    border-bottom: 1px solid var(--border-light);
    padding: 0.75rem 0;
}

.faq details:last-child {
    border-bottom: none;
}

.faq summary {
    cursor: pointer;
    font-weight: 500;
    padding: 0.25rem 0;
}

.faq summary:hover {
    color: var(--primary-blue);
}

.faq details p {
    margin-top: 0.6rem;
    color: var(--text-medium);
    font-size: 0.95rem;
}

/* ===== フォーカス表示 ===== */

.mode-tab:focus-visible,
.dropzone:focus-visible,
.icon-btn:focus-visible,
.btn:focus-visible,
.btn-link:focus-visible,
summary:focus-visible {
    outline: 3px solid var(--primary-blue);
    outline-offset: 2px;
}

/* ===== レスポンシブ ===== */

@media (max-width: 767px) {
    .mode-tabs {
        gap: 0.4rem;
    }

    .mode-tab {
        padding: 0.8rem 0.5rem;
        font-size: 0.95rem;
    }

    /* 一覧はテーブル型からカード型へ切り替える */
    .entry-row {
        flex-wrap: wrap;
        align-items: flex-start;
        padding: 0.75rem;
    }

    .entry-main {
        flex-basis: calc(100% - 4rem);
    }

    .entry-name {
        white-space: normal;
        word-break: break-all;
    }

    .entry-size,
    .entry-date {
        width: auto;
        text-align: left;
        flex-basis: auto;
    }

    .entry-date {
        margin-left: auto;
    }

    .option-row > label,
    .option-row > legend {
        min-width: 100%;
    }

    .filename-input input {
        min-width: 0;
        width: 100%;
    }

    .gate-actions .btn {
        flex: 1;
    }
}
