/* ============================================================
   All2Tools – main.css
   Reset, base, navbar, tool wrapper, panels, dark mode
   ============================================================ */

/* ----- Reset & base ----- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f1f5f9;
    color: #0f172a;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background 0.25s ease, color 0.25s ease;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ============================================================
   NAVBAR
   ============================================================ */
.a2t-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 32px;
    height: 56px;
    transition: background 0.25s ease, border-color 0.25s ease;
}

.a2t-nav-logo {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    letter-spacing: -0.3px;
}

.a2t-nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    flex: 1;
}

/* Nav item (plain link or dropdown trigger) */
.a2t-nav-item {
    position: relative;
}

.a2t-nav-link {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 11px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
    border: none;
    background: none;
    font-family: inherit;
}

.a2t-nav-link:hover,
.a2t-nav-item.is-active > .a2t-nav-link {
    background: #f1f5f9;
    color: #0f172a;
}

.a2t-nav-link.is-current {
    background: #eef2ff;
    color: #4f46e5;
    font-weight: 600;
}

/* Dropdown arrow */
.a2t-nav-arrow {
    width: 14px;
    height: 14px;
    opacity: 0.5;
    transition: transform 0.2s ease;
}

.a2t-nav-item.is-open > .a2t-nav-link .a2t-nav-arrow {
    transform: rotate(180deg);
}

/* Dropdown panel */
.a2t-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 180px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 6px;
    box-shadow: 0 8px 24px rgba(15,23,42,0.10);
    z-index: 200;
}

.a2t-nav-item.is-open > .a2t-dropdown { display: block; }

.a2t-dropdown a {
    display: block;
    padding: 8px 12px;
    border-radius: 9px;
    font-size: 0.86rem;
    font-weight: 500;
    color: #374151;
    transition: background 0.12s ease, color 0.12s ease;
}

.a2t-dropdown a:hover { background: #f1f5f9; color: #0f172a; }
.a2t-dropdown a.is-current { background: #eef2ff; color: #4f46e5; font-weight: 600; }

/* Right side of navbar */
.a2t-nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

/* Dark mode toggle */
.a2t-theme-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 13px;
    border-radius: 999px;
    font-size: 0.83rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #c7d2fe;
    background: #eef2ff;
    color: #4338ca;
    font-family: inherit;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
    white-space: nowrap;
}

.a2t-theme-btn:hover {
    background: #e0e7ff;
    border-color: #a5b4fc;
}

/* Mobile hamburger */
.a2t-nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    margin-left: auto;
}

.a2t-nav-hamburger span {
    display: block;
    height: 2px;
    background: #374151;
    border-radius: 2px;
    transition: background 0.2s;
}

/* ============================================================
   PAGE LAYOUT
   ============================================================ */
.a2t-page {
    flex: 1;
    padding: 24px 16px 24px;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   TOOL WRAPPER  (karta kryesore e çdo tool)
   ============================================================ */
.a2t-wrap {
    width: 960px;
    max-width: 100%;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 4px 20px rgba(15,23,42,0.06);
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

/* ----- Header row inside tool ----- */
.a2t-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 22px;
}

.a2t-title {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: #0f172a;
}

.a2t-subtitle {
    margin-top: 5px;
    font-size: 0.91rem;
    color: #64748b;
    line-height: 1.5;
}

/* ----- Textarea ----- */
.a2t-textarea {
    width: 100%;
    min-height: 200px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1.5px solid #e2e8f0;
    resize: vertical;
    font-family: inherit;
    font-size: 0.97rem;
    line-height: 1.6;
    outline: none;
    background: #f8fafc;
    color: #0f172a;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.a2t-textarea:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
    background: #ffffff;
}

.a2t-textarea::placeholder { color: #94a3b8; }

/* ----- Action row ----- */
.a2t-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.a2t-actions-end { justify-content: flex-end; }
.a2t-actions-start { justify-content: flex-start; }

/* ----- Buttons ----- */
.a2t-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 0.87rem;
    font-weight: 600;
    font-family: inherit;
    line-height: 1;
    transition: background 0.15s ease, opacity 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
}

.a2t-btn-primary {
    background: #4f46e5;
    color: #ffffff;
}

.a2t-btn-primary:hover { background: #4338ca; }

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

.a2t-btn-secondary {
    background: #f1f5f9;
    color: #374151;
    border: 1px solid #e2e8f0;
}

.a2t-btn-secondary:hover { background: #e2e8f0; }

.a2t-btn-ghost {
    background: transparent;
    color: #6b7280;
    border: 1px solid #e2e8f0;
}

.a2t-btn-ghost:hover { background: #f1f5f9; color: #374151; }

/* ----- Panel card ----- */
.a2t-panel {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 16px 18px;
    transition: background 0.25s ease, border-color 0.25s ease;
}

.a2t-panel-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
}

/* ----- Panel grid (2 col) ----- */
.a2t-panels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    margin-top: 20px;
}

/* ----- Stat grid inside panel ----- */
.a2t-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.a2t-stat {
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    transition: background 0.25s ease, border-color 0.25s ease;
}

.a2t-stat-label {
    font-size: 0.72rem;
    color: #6b7280;
    font-weight: 500;
}

.a2t-stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
}

/* ----- Tip / footer note ----- */
.a2t-note {
    font-size: 0.78rem;
    color: #94a3b8;
    line-height: 1.5;
    margin-top: 14px;
}

/* ----- Status messages ----- */
.a2t-status {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.87rem;
    margin-top: 12px;
    display: none;
}

.a2t-status.show { display: block; }
.a2t-status.info    { background: #eef2ff; border: 1px solid #c7d2fe; color: #3730a3; }
.a2t-status.success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.a2t-status.error   { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

/* ----- Divider ----- */
.a2t-divider {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 20px 0;
}

/* ----- Label ----- */
.a2t-label {
    display: block;
    font-size: 0.86rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}

/* ----- Input text ----- */
.a2t-input {
    width: 100%;
    padding: 9px 13px;
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
    background: #f9fafb;
    font: inherit;
    font-size: 0.93rem;
    color: #0f172a;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.a2t-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
    background: #ffffff;
}

/* ----- Dropzone (PDF / file upload) ----- */
.a2t-dropzone {
    position: relative;
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    padding: 36px 20px;
    text-align: center;
    cursor: pointer;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.a2t-dropzone:hover { border-color: #a5b4fc; background: #eef2ff; }

.a2t-dropzone.is-over {
    border-color: #6366f1;
    background: #e0e7ff;
    box-shadow: 0 0 0 4px rgba(99,102,241,0.12);
}

.a2t-dropzone-icon { font-size: 36px; line-height: 1; }

.a2t-dropzone-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.a2t-dropzone-sub {
    font-size: 0.84rem;
    color: #64748b;
}

/* Hidden file input inside dropzone */
.a2t-file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

/* ----- File card (after upload) ----- */
.a2t-file-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #ffffff;
    margin-top: 12px;
}

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

.a2t-file-name {
    font-size: 0.94rem;
    font-weight: 600;
    color: #0f172a;
    word-break: break-word;
}

.a2t-file-meta {
    font-size: 0.78rem;
    color: #6b7280;
    margin-top: 3px;
}

/* ----- Progress bar ----- */
.a2t-progress-wrap {
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid #e0e7ff;
    background: #f5f7ff;
    border-radius: 14px;
}

.a2t-progress-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.83rem;
    color: #374151;
    margin-bottom: 8px;
}

.a2t-progress-track {
    height: 8px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

.a2t-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #6366f1, #818cf8);
    border-radius: 999px;
    transition: width 0.25s ease;
}

/* ----- SEO / about section below tool ----- */
.a2t-seo {
    max-width: 960px;
    margin: 0 auto 20px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 4px 20px rgba(15,23,42,0.06);
    transition: background 0.25s ease, border-color 0.25s ease;
}

.a2t-seo h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 8px;
}

.a2t-seo h2:not(:first-child) { margin-top: 20px; }

.a2t-seo h3 {
    font-size: 0.93rem;
    font-weight: 700;
    color: #374151;
    margin: 14px 0 4px;
}

.a2t-seo p {
    font-size: 0.91rem;
    color: #4b5563;
    line-height: 1.65;
}

.a2t-seo strong { color: #0f172a; }

/* ----- Footer ----- */
.a2t-footer {
    border-top: 1px solid #e2e8f0;
    padding: 18px 24px;
    text-align: center;
    font-size: 0.82rem;
    color: #94a3b8;
    background: #ffffff;
    transition: background 0.25s ease, border-color 0.25s ease;
}

/* ============================================================
   DARK MODE  — class `dark` on <html>
   ============================================================ */
html.dark body {
    background: #080f1e;
    color: #e2e8f0;
}

/* Navbar */
html.dark .a2t-nav {
    background: #0b1120;
    border-color: #1e2d45;
}

html.dark .a2t-nav-logo { color: rgba(255,255,255,0.92); }

html.dark .a2t-nav-link { color: rgba(255,255,255,0.70); }

html.dark .a2t-nav-link:hover,
html.dark .a2t-nav-item.is-active > .a2t-nav-link {
    background: #13203a;
    color: rgba(255,255,255,0.92);
}

html.dark .a2t-nav-link.is-current {
    background: rgba(99,102,241,0.18);
    color: #a5b4fc;
}

html.dark .a2t-dropdown {
    background: #0b1120;
    border-color: #1e2d45;
    box-shadow: 0 8px 28px rgba(0,0,0,0.45);
}

html.dark .a2t-dropdown a { color: rgba(255,255,255,0.70); }
html.dark .a2t-dropdown a:hover { background: #13203a; color: rgba(255,255,255,0.92); }
html.dark .a2t-dropdown a.is-current { background: rgba(99,102,241,0.18); color: #a5b4fc; }

html.dark .a2t-nav-arrow { filter: invert(1); }

/* Theme toggle */
html.dark .a2t-theme-btn {
    background: rgba(99,102,241,0.15);
    border-color: rgba(99,102,241,0.35);
    color: #c7d2fe;
}

html.dark .a2t-theme-btn:hover {
    background: rgba(99,102,241,0.25);
    border-color: rgba(99,102,241,0.55);
}

/* Tool wrapper */
html.dark .a2t-wrap {
    background: #0b1120;
    border-color: #1e2d45;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

/* Title / subtitle */
html.dark .a2t-title { color: rgba(255,255,255,0.94); }
html.dark .a2t-subtitle { color: rgba(255,255,255,0.50); }

/* Textarea */
html.dark .a2t-textarea {
    background: #060d1a;
    border-color: #1e2d45;
    color: #e2e8f0;
}

html.dark .a2t-textarea:focus {
    background: #060d1a;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.20);
}

html.dark .a2t-textarea::placeholder { color: rgba(255,255,255,0.22); }

/* Buttons */
html.dark .a2t-btn-secondary {
    background: #13203a;
    color: #e2e8f0;
    border-color: #1e2d45;
}

html.dark .a2t-btn-secondary:hover { background: #1a2d4d; }

html.dark .a2t-btn-ghost {
    color: rgba(255,255,255,0.50);
    border-color: #1e2d45;
}

html.dark .a2t-btn-ghost:hover { background: #13203a; color: rgba(255,255,255,0.80); }

/* Panel */
html.dark .a2t-panel {
    background: #060d1a;
    border-color: #1e2d45;
}

html.dark .a2t-panel-title { color: rgba(255,255,255,0.82); }

/* Stats */
html.dark .a2t-stat {
    background: #0b1120;
    border-color: #1e2d45;
}

html.dark .a2t-stat-label { color: rgba(255,255,255,0.38); }
html.dark .a2t-stat-value { color: rgba(255,255,255,0.90); }

/* Note */
html.dark .a2t-note { color: rgba(255,255,255,0.28); }

/* Input */
html.dark .a2t-input {
    background: #060d1a;
    border-color: #1e2d45;
    color: #e2e8f0;
}

html.dark .a2t-input:focus {
    background: #060d1a;
    border-color: #6366f1;
}

html.dark .a2t-input::placeholder { color: rgba(255,255,255,0.22); }

/* Label */
html.dark .a2t-label { color: rgba(255,255,255,0.80); }

/* Dropzone */
html.dark .a2t-dropzone {
    background: #060d1a;
    border-color: #1e2d45;
}

html.dark .a2t-dropzone:hover { border-color: #6366f1; background: #0d1530; }
html.dark .a2t-dropzone.is-over { border-color: #818cf8; background: #111f40; }
html.dark .a2t-dropzone-title { color: rgba(255,255,255,0.90); }
html.dark .a2t-dropzone-sub { color: rgba(255,255,255,0.40); }

/* File card */
html.dark .a2t-file-card { background: #060d1a; border-color: #1e2d45; }
html.dark .a2t-file-name { color: rgba(255,255,255,0.90); }
html.dark .a2t-file-meta { color: rgba(255,255,255,0.38); }

/* Progress */
html.dark .a2t-progress-wrap { background: #060d1a; border-color: #1e2d45; }
html.dark .a2t-progress-head { color: rgba(255,255,255,0.60); }
html.dark .a2t-progress-track { background: #1e2d45; }

/* Divider */
html.dark .a2t-divider { border-color: #1e2d45; }

/* SEO section */
html.dark .a2t-seo {
    background: #0b1120;
    border-color: #1e2d45;
}

html.dark .a2t-seo h2 { color: rgba(255,255,255,0.82); }
html.dark .a2t-seo h3 { color: rgba(255,255,255,0.70); }
html.dark .a2t-seo p  { color: rgba(255,255,255,0.55); }
html.dark .a2t-seo strong { color: rgba(255,255,255,0.88); }

/* Footer */
html.dark .a2t-footer {
    background: #0b1120;
    border-color: #1e2d45;
    color: rgba(255,255,255,0.28);
}

/* Hamburger dark */
html.dark .a2t-nav-hamburger span { background: rgba(255,255,255,0.70); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .a2t-nav {
        flex-wrap: wrap;
        height: auto;
        padding: 0 16px;
    }

    .a2t-nav-logo { padding: 14px 0; }

    .a2t-nav-hamburger { display: flex; }

    .a2t-nav-menu {
        display: none;
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        width: 100%;
        padding-bottom: 10px;
    }

    .a2t-nav-menu.is-open { display: flex; }

    .a2t-nav-right { display: none; }
    .a2t-nav-menu.is-open ~ .a2t-nav-right { display: flex; width: 100%; padding-bottom: 10px; }

    .a2t-dropdown {
        position: static;
        box-shadow: none;
        border: none;
        background: transparent;
        padding: 0 0 0 12px;
        border-radius: 0;
    }

    .a2t-wrap, .a2t-seo {
        padding: 18px 16px;
        border-radius: 16px;
    }

    .a2t-title { font-size: 1.45rem; }

    .a2t-header {
        flex-direction: column;
        gap: 10px;
    }

    .a2t-stat-grid { grid-template-columns: 1fr; }
}
