/* PocketSense stylesheet — clean, modern, responsive */

:root {
    --primary: #0066cc;
    --primary-dark: #004a99;
    --primary-light: #e6f0ff;
    --bg: #f8f9fa;
    --surface: #ffffff;
    --text: #1a1a2e;
    --text-muted: #6c757d;
    --border: #e0e0e0;
    --success: #28a745;
    --error: #dc3545;
    --warning: #ffc107;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 2rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand a {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary);
}

.nav-user {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.btn-logout {
    background: none;
    border: 1px solid var(--border);
    padding: 0.35rem 0.8rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
}

.btn-logout:hover {
    background: var(--bg);
    color: var(--error);
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

.footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

/* Auth pages */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 2.5rem;
    max-width: 460px;
    width: 100%;
}

.auth-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.auth-form { margin-top: 1.5rem; }

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

.form-group input, .auth-form input {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.btn {
    display: inline-block;
    padding: 0.7rem 1.2rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-full {
    width: 100%;
    text-align: center;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
}

.auth-info {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.auth-info h3 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.auth-info ol {
    padding-left: 1.2rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.auth-info li {
    margin-bottom: 0.3rem;
}

.muted { color: var(--text-muted); font-size: 0.85rem; }

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-error {
    background: #fee;
    color: var(--error);
    border: 1px solid #fcc;
}

.alert-success {
    background: #efe;
    color: var(--success);
    border: 1px solid #cfc;
}

.alert-warning {
    background: #fff8e1;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Predict page layout */
.predict-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 1.5rem;
}

.panel {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.input-panel h2, .results-panel h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

/* Input methods tabs */
.input-methods {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tab-label {
    flex: 1;
    cursor: pointer;
}

.tab-label input { display: none; }

.tab-label span {
    display: block;
    text-align: center;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: all 0.2s;
}

.tab-label input:checked + span {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Dropzone */
.dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.dropzone .filename {
    margin-top: 0.5rem;
    font-weight: 500;
    color: var(--primary);
}

/* Paste textarea */
.input-section textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.7rem;
    font-family: monospace;
    font-size: 0.85rem;
    resize: vertical;
}

/* Advanced params */
.advanced-params {
    margin: 1rem 0;
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
}

.advanced-params summary {
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-muted);
    padding: 0.5rem 0;
}

.param-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-top: 0.75rem;
}

.param label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

.param input {
    width: 100%;
    padding: 0.4rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.85rem;
}

.param-checks {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.param-checks label {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Loading */
.loading {
    text-align: center;
    padding: 3rem;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

/* Results: metrics */
.metrics-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.metric-card {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 0.75rem;
    text-align: center;
    border-left: 3px solid var(--primary);
}

.metric-card .metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

.metric-card .metric-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Results: viewer */
.viewer-container {
    background: #1a1a2e;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1.5rem;
    position: relative;
}

#viewer { width: 100%; height: 500px; }

/* Results: tables */
.results-section { margin-bottom: 1.5rem; }

.results-section h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

table.data-table th {
    background: var(--bg);
    padding: 0.6rem 0.5rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

table.data-table td {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border);
}

table.data-table tr:hover {
    background: var(--primary-light);
}

.prob-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.prob-high { background: #d4edda; color: #155724; }
.prob-mid  { background: #fff3cd; color: #856404; }
.prob-low  { background: #f8d7da; color: #721c24; }

.check-yes { color: var(--success); font-weight: 600; }
.check-no  { color: var(--text-muted); }

/* Downloads */
.downloads {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.btn-download {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-download:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

/* Guide page */
.guide-container {
    max-width: 800px;
    padding: 2rem;
}

.guide-container h1 {
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
}

.guide-container h2 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.guide-container h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
}

.guide-container p {
    margin-bottom: 0.75rem;
}

.guide-container ul, .guide-container ol {
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
}

.guide-container li {
    margin-bottom: 0.3rem;
}

.guide-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.guide-table th, .guide-table td {
    padding: 0.6rem;
    border: 1px solid var(--border);
    text-align: left;
    font-size: 0.9rem;
}

.guide-table th {
    background: var(--bg);
    font-weight: 600;
}

.references {
    list-style: none;
    padding-left: 0;
}

.references li {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 900px) {
    .predict-layout {
        grid-template-columns: 1fr;
    }
    .metrics-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .navbar {
        padding: 0.5rem 1rem;
    }
    .nav-links {
        gap: 0.8rem;
    }
    .nav-user { display: none; }
}
