/* PrimalPDF — Clean, professional, no-nonsense */

:root {
    --bg: #0e0e12;
    --bg-card: #16161d;
    --bg-hover: #1e1e28;
    --text: #e0ddd8;
    --text-muted: #8a8780;
    --accent: #2d7ff9;
    --accent-hover: #1a6be0;
    --success: #22c55e;
    --error: #ef4444;
    --border: #2a2a35;
    --radius: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
}

.nav-brand {
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo {
    background: var(--accent);
    color: white;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-weight: 800;
    font-size: 1.1rem;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.token-badge {
    background: var(--accent);
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Buttons */
.btn {
    padding: 8px 18px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.15s;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover { background: var(--bg-hover); }

.btn-large { padding: 12px 32px; font-size: 1rem; }

/* Container */
.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Hero */
.hero {
    text-align: center;
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.hero .sub {
    font-size: 0.95rem;
    margin-top: 4px;
}

/* Card */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
}

.card-center { text-align: center; }

/* Converter card */
.converter-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 24px;
}

/* Drop zone */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 20px;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--accent);
    background: rgba(45, 127, 249, 0.05);
}

.drop-icon { font-size: 2.5rem; margin-bottom: 8px; }

.drop-zone p { color: var(--text-muted); }

.drop-zone .link {
    color: var(--accent);
    cursor: pointer;
    text-decoration: underline;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    margin-top: 10px;
    color: var(--text);
}

.file-info #file-name { font-weight: 600; }
.file-info #file-size { color: var(--text-muted); font-size: 0.85rem; }

.btn-clear {
    background: none;
    border: none;
    color: var(--error);
    font-size: 1.2rem;
    cursor: pointer;
}

/* Classify result */
.classify-result {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 10px 16px;
    background: var(--bg-hover);
    border-radius: 8px;
    font-size: 0.9rem;
}

.classify-tag {
    background: var(--accent);
    color: white;
    padding: 2px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.token-cost {
    margin-left: auto;
    color: var(--accent);
    font-weight: 600;
}

/* Format selector */
.format-row {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.format-option {
    cursor: pointer;
}

.format-option input { display: none; }

.format-label {
    display: inline-block;
    padding: 8px 24px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.15s;
    color: var(--text-muted);
}

.format-option input:checked + .format-label {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(45, 127, 249, 0.1);
}

/* Progress */
.progress-bar {
    height: 36px;
    background: var(--bg-hover);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    margin-top: 16px;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.3s;
    border-radius: 8px;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
}

/* Result */
.result { margin-top: 16px; padding: 12px 16px; border-radius: 8px; }
.result-success { background: rgba(34, 197, 94, 0.1); color: var(--success); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.result-error { background: rgba(239, 68, 68, 0.1); color: var(--error); }

.btn-download {
    background: var(--success);
    color: white;
    padding: 6px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: auto;
    transition: opacity 0.15s;
}

.btn-download:hover { opacity: 0.85; }

/* Tools row */
.tools-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    cursor: pointer;
    transition: all 0.15s;
}

.tool-card:hover { border-color: var(--accent); background: var(--bg-hover); }

.tool-card h3 { font-size: 1rem; margin-bottom: 4px; }
.tool-card p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 8px; }
.tool-cost { font-size: 0.8rem; color: var(--accent); font-weight: 600; }

/* Costs table */
.costs-table {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.costs-table h3 { margin-bottom: 12px; font-size: 1rem; }

.cost-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.cost-row:last-child { border-bottom: none; }
.cost-row .cost-name { color: var(--text); }
.cost-row .cost-tokens { color: var(--accent); font-weight: 600; }

/* Features grid */
.features {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-top: 40px;
}

.feature {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.feature h3 { margin-bottom: 8px; font-size: 1rem; }
.feature p { font-size: 0.85rem; color: var(--text-muted); }

/* Install banner */
.install-banner {
    background: linear-gradient(135deg, #1a3a6b 0%, #2d7ff9 100%);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.install-banner-content {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 720px;
    width: 100%;
    font-size: 0.9rem;
}

.install-banner-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
    align-items: center;
}

.btn-small { padding: 5px 14px; font-size: 0.8rem; }

.btn-install {
    background: var(--success);
    color: white;
    padding: 6px 14px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
}

.btn-install:hover { opacity: 0.9; }

.btn-install-landing {
    background: transparent;
    border: 2px solid var(--success);
    color: var(--success);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.15s;
}

.btn-install-landing:hover {
    background: var(--success);
    color: white;
}

.landing-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
    flex-wrap: wrap;
}

.btn-dismiss {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0 4px;
}

.btn-dismiss:hover { color: white; }

/* Install help modal */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-width: 560px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 12px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 { font-size: 1.2rem; }

.modal-body {
    padding: 20px 24px 24px;
}

.modal-body > p {
    color: var(--text-muted);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.install-section {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-hover);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.install-section.install-highlight {
    border-color: var(--accent);
    background: rgba(45, 127, 249, 0.08);
}

.install-section h3 {
    font-size: 0.95rem;
    margin-bottom: 10px;
    color: var(--accent);
}

.install-section ol, .install-section ul {
    margin-left: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.install-section li {
    margin-bottom: 6px;
    line-height: 1.5;
}

.install-section strong { color: var(--text); }

.install-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

/* Free label */
.free-tag {
    background: var(--success);
    color: white;
    font-size: 0.6rem;
    padding: 1px 5px;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 4px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.free-label {
    color: var(--success) !important;
    font-weight: 600;
}

/* Platform note */
.platform-note {
    color: var(--accent) !important;
    font-weight: 500;
    margin-top: 8px !important;
}

/* Responsive */
@media (max-width: 600px) {
    .features { grid-template-columns: 1fr; }
    .tools-row { grid-template-columns: 1fr; }
    .hero h1 { font-size: 1.5rem; }
    .install-banner-content { flex-direction: column; gap: 8px; text-align: center; }
    .install-banner-actions { margin-left: 0; }
    .navbar { flex-wrap: wrap; gap: 8px; }
    .nav-right { flex-wrap: wrap; gap: 8px; }
}

/* PWA standalone mode tweaks */
@media (display-mode: standalone) {
    .install-banner { display: none !important; }
    #btn-install { display: none !important; }
}
