/* =========================================================
   niDar Tools - PDF Merger & Splitter
   Tool-specific UI
   Uses global niDar theme variables
   ========================================================= */

.tool-main-container {
    width: 100%;
    max-width: 900px;
    margin: 40px auto 70px;
    padding: 0 20px;
}

.tool-card {
    background: var(--card, #172235);
    color: var(--text, #f1f5f9);
    border: 1px solid var(--border, #334155);
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
}

/* ---------- TOOL TITLE ---------- */

.tool-card h1 {
    margin: 0 0 10px;
    text-align: center;
    color: var(--text, #f1f5f9);
    font-size: clamp(26px, 5vw, 36px);
    font-weight: 800;
    line-height: 1.2;
}

.tool-subtitle {
    max-width: 680px;
    margin: 0 auto 28px;
    text-align: center;
    color: var(--muted, #94a3b8);
    font-size: 15px;
    line-height: 1.7;
}

/* ---------- TABS ---------- */

.tab-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 26px;
    padding: 5px;
    background: var(--bg, #0b0f19);
    border: 1px solid var(--border, #334155);
    border-radius: 14px;
}

.tab-btn {
    flex: 1;
    min-height: 46px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--muted, #94a3b8);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--text, #f1f5f9);
    border-color: var(--border, #334155);
}

.tab-btn.active {
    background: var(--primary, #4caf50);
    color: #ffffff;
    box-shadow: 0 5px 16px rgba(46, 125, 50, 0.25);
}

/* ---------- TOOL SECTIONS ---------- */

.tool-section {
    display: none;
}

.tool-section.active {
    display: block;
}

/* ---------- DROP ZONE ---------- */

.drop-zone {
    min-height: 210px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 32px 22px;
    text-align: center;
    background: var(--bg, #0b0f19);
    border: 2px dashed var(--border, #334155);
    border-radius: 16px;
    transition: all 0.25s ease;
}

.drop-zone:hover {
    border-color: var(--primary, #4caf50);
    background: color-mix(in srgb, var(--primary, #4caf50) 6%, var(--bg, #0b0f19));
    transform: translateY(-1px);
}

.drop-zone p {
    margin: 0;
    color: var(--muted, #94a3b8);
    font-size: 14px;
    line-height: 1.7;
}

.drop-zone::before {
    content: "📄";
    display: block;
    font-size: 42px;
    margin-bottom: 4px;
}

/* ---------- BROWSE ---------- */

.browse-btn {
    color: var(--primary, #4caf50);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.browse-btn:hover {
    text-decoration: underline;
}

/* ---------- FILE LIST ---------- */

.file-list {
    list-style: none;
    margin: 18px 0 0;
    padding: 0;
    max-height: 190px;
    overflow-y: auto;
}

.file-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    padding: 11px 13px;
    background: var(--bg, #0b0f19);
    border: 1px solid var(--border, #334155);
    border-radius: 10px;
    color: var(--text, #f1f5f9);
    font-size: 13px;
    line-height: 1.4;
}

.file-list li span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- ACTION BUTTONS ---------- */

.action-btn,
.download-btn {
    display: block;
    width: 100%;
    min-height: 48px;
    margin-top: 20px;
    padding: 12px 18px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--primary, #4caf50);
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover:not(:disabled),
.download-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 7px 18px rgba(46, 125, 50, 0.22);
}

.action-btn:active,
.download-btn:active {
    transform: translateY(0);
}

.action-btn:disabled {
    background: #64748b;
    color: #e2e8f0;
    cursor: not-allowed;
    opacity: 0.65;
    box-shadow: none;
}

/* ---------- SPLIT FILE INFO ---------- */

.file-info {
    margin: 18px 0 0;
    padding: 13px 15px;
    background: var(--bg, #0b0f19);
    border: 1px solid var(--border, #334155);
    border-radius: 10px;
    color: var(--text, #f1f5f9);
    font-size: 14px;
    line-height: 1.5;
}

/* ---------- OUTPUT ---------- */

.output-container {
    margin-top: 24px;
    padding: 20px;
    text-align: center;
    background: var(--bg, #0b0f19);
    border: 1px solid var(--border, #334155);
    border-radius: 14px;
}

#status-message {
    margin: 0;
    color: var(--text, #f1f5f9);
    font-size: 14px;
    line-height: 1.6;
}

/* ---------- HIDDEN ---------- */

.hidden {
    display: none !important;
}

/* ---------- MOBILE ---------- */

@media (max-width: 700px) {
    .tool-main-container {
        margin: 24px auto 50px;
        padding: 0 14px;
    }

    .tool-card {
        padding: 20px 14px;
        border-radius: 16px;
    }

    .tool-subtitle {
        font-size: 14px;
        margin-bottom: 22px;
    }

    .tab-buttons {
        gap: 6px;
    }

    .tab-btn {
        min-height: 44px;
        font-size: 14px;
    }

    .drop-zone {
        min-height: 190px;
        padding: 26px 16px;
        border-radius: 14px;
    }

    .drop-zone::before {
        font-size: 36px;
    }

    .file-list li {
        padding: 10px;
    }
}

/* ---------- SENIOR / HIGH CONTRAST ---------- */

html[data-theme="senior"] .tool-card {
    border-width: 2px;
    box-shadow: none;
}

html[data-theme="senior"] .tab-buttons,
html[data-theme="senior"] .drop-zone,
html[data-theme="senior"] .file-list li,
html[data-theme="senior"] .file-info,
html[data-theme="senior"] .output-container {
    border-width: 2px;
}

html[data-theme="senior"] .tab-btn.active,
html[data-theme="senior"] .action-btn,
html[data-theme="senior"] .download-btn {
    color: #000000;
    font-weight: 800;
}

@media (prefers-reduced-motion: reduce) {
    .tab-btn,
    .drop-zone,
    .action-btn,
    .download-btn {
        transition: none;
    }
}
