/* ==========================================================================
   SITE.CSS - General Site-Wide Styles
   ========================================================================== */

/* Theme Colors and Variables */
html[data-theme="dark"] {
    background: #0b1220;
}

:root {
    --accent: #4f46e5;
    --accent2: #06b6d4;
}

:target {
    scroll-margin-top: 80px;
}

[data-theme="dark"] {
    --bg: #0b1220;
    --card: #0f1724;
    --text: #e6eef8;
    --muted: #94a3b8;
    --header-bg: rgba(11, 18, 32, 0.6);
    --border: rgba(255, 255, 255, 0.15);
}

[data-theme="light"] {
    --bg: #f9fafb;
    --card: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --header-bg: rgba(255, 255, 255, 0.6);
    --border: rgba(0, 0, 0, 0.15);
}

/* Base Styles */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.45;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 18px;
}

h1 {
    margin: 0;
    font-size: 32px;
    line-height: 1.1;
}

p.lead {
    color: var(--muted);
    max-width: 60ch;
}


/* List Styles */
ul, ol {
    margin: 14px 0;
    padding-left: 24px;
    color: var(--text);
    line-height: 1.6;
}

li {
    margin-bottom: 8px;
    color: var(--text);
}

li:last-child {
    margin-bottom: 0;
}

/* For lists inside content areas (only for .card context) */
.card ul,
.card ol {
    max-width: 65ch;
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

header .inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    display: grid;
    place-items: center;
    font-weight: 700;
    color: #fff;
}

.logo-text {
    font-weight: 800;
    font-size: larger;
}

nav {
    display: flex;
    gap: 18px;
    align-items: center;
}

nav a,
.footer-links a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.2s ease;
}

nav a:hover,
.footer-links a:hover {
    color: var(--accent);
}

/* User Avatar */
.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.user-avatar:hover {
    background: color-mix(in srgb, var(--card) 85%, black);
    border-color: var(--accent);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
}

.user-avatar-initial {
    line-height: 1;
}

.cta {
    background: var(--accent);
    padding: 8px 14px;
    border-radius: 10px;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
}

.cta:hover {
    background: color-mix(in srgb, var(--accent) 80%, black);
    color: #fff;
}

.cta-btn {
    border: none;
    cursor: pointer;
}

.toggle-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    color: var(--muted);
}

/* Footer */
footer {
    margin-top: 44px;
    padding: 24px 0;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 14px;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 18px;
}

/* Shared Components */
.code-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    margin: 14px 0;
    overflow-x: auto;
}

.code-box-text {
    margin: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.section-title {
    font-size: 2em;
    font-weight: 600;
    text-align: center;
    margin-bottom: 40px;
    color: var(--text);
    position: relative;
}

.section-title::after {
    content: "";
    display: block;
    width: 60px;
    height: 3px;
    margin: 12px auto 0;
    background-color: var(--accent);
    border-radius: 2px;
}

/* Cards */
.card {
    background: var(--card);
    padding: 18px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.card h3 {
    margin: 0 0 6px;
    font-size: 16px;
}

.card p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.card-cta {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 14px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-cta:hover {
    background: color-mix(in srgb, var(--accent) 80%, black);
    color: #fff;
}

/* List styles inside cards */
.card ul,
.card ol {
    margin: 14px 0;
    padding-left: 24px;
    line-height: 1.6;
}

.card li {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 14px;
}

.card li:last-child {
    margin-bottom: 0;
}

/* Buttons */
.process-btn {
    padding: 6px 10px;
    font-size: 13px;
    border: none;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
}

.process-btn:hover {
    background: color-mix(in srgb, var(--accent) 80%, black);
}

.process-btn.uploading {
    background-color: #a3a3a3;
    cursor: not-allowed;
}

.process-btn.ready {
    background-color: #4f46e5;
    cursor: pointer;
}

.process-btn.processing {
    background-color: #f59e0b;
    cursor: wait;
}

.process-btn.done {
    background-color: #16a34a;
}

.process-btn.error {
    background-color: #dc2626;
}

.process-btn.uploading:hover,
.process-btn.processing:hover {
    opacity: 1;
}

.remove-btn {
    padding: 6px 10px;
    font-size: 18px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #000000;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
    line-height: 1;
    min-width: 36px;
}

.remove-btn:hover {
    background: #1a1a1a;
}

.file-actions {
    display: flex;
    gap: 8px;
}

/* Spinner */
.spinner {
    position: absolute;
    margin-top: 10px;
    margin-bottom: 5px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 4px solid rgba(0,0,0,0.1);
    border-top: 4px solid var(--accent);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    animation: spin 1s linear infinite;
    z-index: 10;
}

.spinner.hidden {
    display: none;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Forms */
.form input[type="text"],
.form input[type="email"],
.form input[type="password"],
.form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    color: var(--text);
    font-size: 14px;
    margin-bottom: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    color: var(--text);
    font-size: 14px;
    margin-bottom: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
}

.form select:hover {
    border-color: color-mix(in srgb, var(--border) 80%, var(--accent));
}

.form input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 4px;
    background: var(--card);
    cursor: pointer;
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    margin: 0;
    vertical-align: middle;
}

.form input[type="checkbox"]:hover {
    border-color: var(--accent);
}

.form input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
}

.form input[type="checkbox"]:checked::before {
    content: "✓";
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.form input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
}

.form input:focus,
.form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
}

.form label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: var(--text);
}

.form .cta {
    display: inline-block;
    width: 100%;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.form .cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.divider {
    position: relative;
    text-align: center;
    margin: 24px 0;
    color: var(--muted);
    font-size: 14px;
}

.divider::before,
.divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 45%;
    height: 1px;
    background: var(--border);
}

.divider::before { left: 0; }
.divider::after { right: 0; }

.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #fff;
    color: #000;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s ease, transform 0.2s ease;
}

.google-btn:hover {
    background: #f3f3f3;
    transform: translateY(-2px);
}

.google-btn img {
    width: 18px;
    height: 18px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
}

.auth-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.auth-card h1 {
    margin-top: 0;
}

.auth-card .lead {
    color: var(--muted);
    margin-bottom: 24px;
}

/* Smooth Transitions */
body,
header,
.card,
footer {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Remove lift effects */
.cta:hover,
.card-cta:hover,
.form .cta:hover,
.google-btn:hover {
    transform: none !important;
    box-shadow: none !important;
    filter: brightness(0.95);
}

/* Responsive */
@media (max-width: 600px) {
    .footer-inner {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 24px 16px;
    }
}

@media (min-width: 800px) {
    h1 {
        font-size: 44px;
    }
}


/* Toast */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: #333;
    color: #fff;
    padding: 12px 18px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    font-size: 15px;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    background: #2ecc71;
}

.toast-error {
    background: #e74c3c;
}

.toast-info {
    background: #3498db;
}

.toast-warning {
    background: #f39c12;
}