/* ============================================================
   Excel Converter Suite — frontend styles (all scoped under .xc)
   Modern card design: gradient dropzone, pill buttons, step cards
   ============================================================ */
.xc {
    --xc-primary: #2563eb;
    --xc-primary-2: #4f46e5;
    --xc-primary-dark: #1e40af;
    --xc-ink: #0f172a;
    --xc-soft: #334155;
    --xc-muted: #64748b;
    --xc-line: #e2e8f0;
    --xc-bg: #f8fafc;
    --xc-grad: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    --xc-shadow: 0 10px 30px rgba(37, 99, 235, .12);
    --xc-radius: 18px;
    max-width: 880px;
    margin: 2rem auto;
    color: var(--xc-ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
}

/* ---------- Dropzone ---------- */
.xc-drop {
    position: relative;
    border: 2.5px dashed #a5b4fc;
    border-radius: 22px;
    background: linear-gradient(135deg, #eff6ff 0%, #eef2ff 60%, #f5f3ff 100%);
    padding: 3.25rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color .25s, box-shadow .25s, transform .2s;
    overflow: hidden;
}
.xc-drop::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(600px 200px at 50% -60px, rgba(79, 70, 229, .12), transparent 70%);
    pointer-events: none;
}
.xc-drop:hover,
.xc-drop:focus-visible {
    border-color: var(--xc-primary);
    box-shadow: var(--xc-shadow);
    transform: translateY(-2px);
    outline: none;
}
.xc-drop.xc-dragover {
    border-color: var(--xc-primary);
    border-style: solid;
    box-shadow: var(--xc-shadow);
    transform: scale(1.015);
}
.xc-drop-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: #fff;
    color: var(--xc-primary);
    box-shadow: 0 8px 20px rgba(37, 99, 235, .18);
    margin-bottom: 1rem;
    transition: transform .25s;
}
.xc-drop:hover .xc-drop-icon { transform: translateY(-4px); }
.xc-drop-icon svg { width: 40px; height: 40px; }
.xc-drop-title {
    position: relative;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -.01em;
}
.xc-drop-sub { position: relative; color: var(--xc-muted); margin-top: .5rem; font-size: 1rem; }
.xc-browse {
    display: inline-block;
    margin-top: .15rem;
    padding: .45rem 1.3rem;
    border-radius: 999px;
    background: var(--xc-grad);
    color: #fff !important;
    font-weight: 700;
    font-size: .95rem;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(37, 99, 235, .35);
    transition: transform .2s, box-shadow .2s;
    cursor: pointer;
}
.xc-browse:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(37, 99, 235, .45); }

/* ---------- Error ---------- */
.xc-error {
    margin-top: 1rem;
    padding: .9rem 1.1rem;
    border-radius: 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid #ef4444;
    color: #b91c1c;
    font-size: .95rem;
    font-weight: 500;
}

/* ---------- Panel (file ready) ---------- */
.xc-panel {
    margin-top: 1.25rem;
    border: 1px solid var(--xc-line);
    border-radius: 22px;
    background: #fff;
    padding: 1.75rem;
    box-shadow: 0 14px 40px rgba(15, 23, 42, .08);
}
.xc-filebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.4rem;
    padding: .9rem 1.1rem;
    border-radius: 14px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}
.xc-filename {
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #166534;
    display: flex;
    align-items: center;
    gap: .5rem;
    min-width: 0;
}
.xc-filename::before {
    content: "";
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #22c55e url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/12px no-repeat;
}
.xc-link {
    background: #fff;
    border: 1px solid var(--xc-line);
    border-radius: 999px;
    padding: .4rem .95rem;
    color: var(--xc-soft);
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color .2s, color .2s;
}
.xc-link:hover { border-color: var(--xc-primary); color: var(--xc-primary); }

.xc-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-bottom: 1.4rem; }
.xc-field {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    font-size: .85rem;
    font-weight: 700;
    color: var(--xc-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.xc-field select {
    appearance: none;
    -webkit-appearance: none;
    padding: .75rem 2.5rem .75rem 1rem;
    border: 1.5px solid var(--xc-line);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--xc-ink);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") right .9rem center/18px no-repeat;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s;
}
.xc-field select:hover { border-color: #a5b4fc; }
.xc-field select:focus { border-color: var(--xc-primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); outline: none; }

/* ---------- Preview ---------- */
.xc-preview-wrap { margin-bottom: 1.5rem; }
.xc-preview-title {
    font-weight: 800;
    margin-bottom: .6rem;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--xc-muted);
}
.xc-preview {
    max-height: 340px;
    overflow: auto;
    border: 1px solid var(--xc-line);
    border-radius: 14px;
    background: var(--xc-bg);
}
.xc-preview table { border-collapse: collapse; width: 100%; font-size: .87rem; }
.xc-preview th, .xc-preview td {
    border: 1px solid var(--xc-line);
    padding: .55rem .7rem;
    text-align: left;
    white-space: nowrap;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.xc-preview th {
    background: linear-gradient(180deg, #eef2ff, #e0e7ff);
    color: var(--xc-primary-dark);
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 1;
}
.xc-preview tbody tr:nth-child(even) td { background: #fff; }
.xc-preview tbody tr:hover td { background: #eff6ff; }
.xc-empty { padding: 1.25rem; color: var(--xc-muted); text-align: center; }

/* ---------- Convert button + progress ---------- */
.xc-btn {
    display: block;
    width: 100%;
    padding: 1.05rem 1.25rem;
    border: none;
    border-radius: 14px;
    background: var(--xc-grad);
    color: #fff;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: .01em;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(37, 99, 235, .35);
    transition: transform .18s, box-shadow .2s, filter .2s;
}
.xc-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(37, 99, 235, .45); filter: brightness(1.05); }
.xc-btn:active:not(:disabled) { transform: translateY(0); }
.xc-btn:disabled { opacity: .65; cursor: wait; transform: none; }
.xc-progress {
    display: flex; align-items: center; justify-content: center; gap: .65rem;
    margin-top: 1.1rem; color: var(--xc-muted); font-size: .95rem; font-weight: 500;
}
.xc-spinner {
    width: 22px; height: 22px;
    border: 3px solid var(--xc-line);
    border-top-color: var(--xc-primary);
    border-radius: 50%;
    animation: xc-spin .8s linear infinite;
}
@keyframes xc-spin { to { transform: rotate(360deg); } }

.xc-privacy {
    display: inline-block;
    margin: 1.25rem auto 0;
    padding: .55rem 1.1rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--xc-muted);
    font-size: .88rem;
    font-weight: 500;
    text-align: center;
}
.xc .xc-privacy { display: block; width: fit-content; }

/* ---------- How-to: numbered step cards ---------- */
.xc-how { margin-top: 3rem; }
.xc-how h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.01em; margin-bottom: 1.1rem; text-align: center; }
.xc-how ol {
    list-style: none;
    counter-reset: xc-step;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
.xc-how li {
    counter-increment: xc-step;
    position: relative;
    background: #fff;
    border: 1px solid var(--xc-line);
    border-radius: var(--xc-radius);
    padding: 1.4rem 1.2rem 1.2rem;
    margin: 0;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .05);
    font-size: .95rem;
    color: var(--xc-soft);
}
.xc-how li::before {
    content: counter(xc-step);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--xc-grad);
    color: #fff;
    font-weight: 800;
    font-size: 1.05rem;
    margin-bottom: .8rem;
    box-shadow: 0 6px 14px rgba(37, 99, 235, .35);
}
.xc-how li strong { display: block; color: var(--xc-ink); margin-bottom: .15rem; }

/* ---------- FAQ accordion ---------- */
.xc-faq-block { margin-top: 0; }
.xc-faq h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.01em; margin-bottom: 1.1rem; text-align: center; }
.xc-qa {
    border: 1px solid var(--xc-line);
    border-radius: 14px;
    margin-bottom: .7rem;
    background: #fff;
    overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
}
.xc-qa[open] { border-color: #a5b4fc; box-shadow: var(--xc-shadow); }
.xc-qa summary {
    padding: 1rem 1.2rem;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.xc-qa summary::-webkit-details-marker { display: none; }
.xc-qa summary::after {
    content: "+";
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #eef2ff;
    color: var(--xc-primary);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 30px;
    text-align: center;
    transition: transform .25s, background .2s, color .2s;
}
.xc-qa[open] summary::after {
    content: "−";
    background: var(--xc-grad);
    color: #fff;
    transform: rotate(180deg);
}
.xc-qa p { padding: 0 1.2rem 1.15rem; margin: 0; color: var(--xc-soft); }

/* ---------- Responsive ---------- */
@media (max-width: 700px) {
    .xc-how ol { grid-template-columns: 1fr; }
    .xc-drop { padding: 2.25rem 1.25rem; }
    .xc-drop-title { font-size: 1.25rem; }
    .xc-panel { padding: 1.15rem; }
    .xc-filebar { flex-direction: column; align-items: stretch; }
    .xc-link { text-align: center; }
}
