/* ========================================
   NotResume.com - Main Stylesheet
   Modern, light, bold typography
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Space+Mono:wght@400;700&display=swap');

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

:root {
    --bg: #FAFAF9;
    --bg-card: #FFFFFF;
    --bg-hover: #F5F5F4;
    --text-primary: #0C0A09;
    --text-secondary: #57534E;
    --text-muted: #A8A29E;
    --border: #E7E5E4;
    --border-focus: #0C0A09;
    --accent: #0C0A09;
    --accent-hover: #292524;
    --accent-text: #FFFFFF;
    --success: #15803D;
    --success-bg: #F0FDF4;
    --error: #DC2626;
    --error-bg: #FEF2F2;
    --warning: #D97706;
    --warning-bg: #FFFBEB;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.1);
    --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'Space Mono', 'SF Mono', 'Fira Code', monospace;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    font-size: 18px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--text-secondary);
}

img {
    max-width: 100%;
    display: block;
}

/* ---- Layout ---- */
.container {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-wide {
    max-width: 960px;
}

/* ---- Header / Nav ---- */
.site-header {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.9);
}

.header-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 38px;
    width: auto;
}

.logo span {
    color: var(--text-muted);
    font-weight: 400;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links a {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition);
}

.nav-links a:hover {
    background: var(--bg-hover);
}

.nav-links a.btn-primary {
    background: var(--accent);
    color: var(--accent-text);
}

.nav-links a.btn-primary:hover {
    background: var(--accent-hover);
}

/* ---- Typography ---- */
h1 {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.1;
}

h2 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

h3 {
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.98);
}

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

.btn-primary:hover {
    background: var(--accent-hover);
    color: var(--accent-text);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1.5px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

.btn-danger {
    background: var(--error);
    color: #fff;
}

.btn-danger:hover {
    background: #B91C1C;
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 12px;
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.05rem;
    border-radius: var(--radius);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
}

.btn:disabled, .btn.loading {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ---- Forms ---- */
.form-group {
    margin-bottom: 20px;
}

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

.form-input {
    width: 100%;
    padding: 14px 16px;
    font-family: var(--font-sans);
    font-size: 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    transition: all var(--transition);
    outline: none;
}

.form-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(12, 10, 9, 0.08);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-hint {
    margin-top: 6px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ---- Cards ---- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: all var(--transition);
}

.card-hover:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--text-muted);
}

/* ---- Alerts ---- */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.5;
}

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

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

.alert-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid #FDE68A;
}

.alert-info {
    background: #EFF6FF;
    color: #1D4ED8;
    border: 1px solid #BFDBFE;
}

/* ---- Hero (Landing Page) ---- */
.hero {
    padding: 100px 0 80px;
    text-align: center;
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #0C0A09 0%, #44403C 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 480px;
    margin: 0 auto 40px;
    line-height: 1.6;
}

.hero-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 80px;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.hero-feature {
    text-align: center;
    padding: 32px 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card);
}

.hero-feature .feature-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.hero-feature h3 {
    font-size: 1.05rem;
    margin-bottom: 8px;
}

.hero-feature p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ---- Auth Pages ---- */
.auth-wrapper {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
}

.auth-card h1 {
    font-size: 2rem;
    margin-bottom: 8px;
}

.auth-card .subtitle {
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 1rem;
}

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

.auth-footer a {
    font-weight: 600;
    color: var(--text-primary);
}

/* ---- Dashboard ---- */
.dashboard-header {
    padding: 48px 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.dashboard-header h1 {
    font-size: 2rem;
}

.page-list {
    display: grid;
    gap: 16px;
    padding-bottom: 60px;
}

.page-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all var(--transition);
    gap: 16px;
}

.page-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--text-muted);
}

.page-card-info {
    flex: 1;
    min-width: 0;
}

.page-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.page-card-slug {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
}

.page-card-slug a {
    color: var(--text-secondary);
}

.page-card-slug a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.page-card-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.page-card-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.empty-state {
    text-align: center;
    padding: 80px 24px;
    color: var(--text-secondary);
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h3 {
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state p {
    max-width: 360px;
    margin: 0 auto 24px;
    font-size: 0.95rem;
}

/* ---- Create/Edit Page ---- */
.create-wrapper {
    padding: 48px 0 60px;
}

.create-wrapper h1 {
    font-size: 2rem;
    margin-bottom: 32px;
}

/* AI Prompt Input - styled like Claude's input */
.ai-prompt-area {
    position: relative;
    margin-bottom: 24px;
}

.ai-textarea {
    width: 100%;
    min-height: 180px;
    padding: 20px;
    padding-right: 60px;
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.7;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    color: var(--text-primary);
    resize: vertical;
    outline: none;
    transition: all var(--transition);
}

.ai-textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px rgba(12, 10, 9, 0.06);
}

.ai-textarea::placeholder {
    color: var(--text-muted);
    font-size: 1rem;
}

.upload-btn-wrapper {
    position: absolute;
    bottom: 16px;
    right: 16px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.upload-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    color: var(--text-secondary);
    font-size: 1.2rem;
    position: relative;
    overflow: hidden;
}

.upload-btn:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

.upload-btn input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: var(--accent-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    font-size: 1.1rem;
}

.send-btn:hover {
    background: var(--accent-hover);
}

.send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.file-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-hover);
    border-radius: 20px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.file-badge .remove-file {
    cursor: pointer;
    font-weight: 700;
    color: var(--text-muted);
    transition: color var(--transition);
}

.file-badge .remove-file:hover {
    color: var(--error);
}

/* Preview area */
.preview-area {
    margin-top: 32px;
    padding: 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    min-height: 200px;
    display: none;
}

.preview-area.active {
    display: block;
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2.5px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

.generating-indicator {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.generating-indicator.active {
    display: flex;
}

/* Slug input */
.slug-input-group {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: all var(--transition);
}

.slug-input-group:focus-within {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(12, 10, 9, 0.08);
}

.slug-prefix {
    padding: 14px 2px 14px 16px;
    background: var(--bg-hover);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
    border-right: 1px solid var(--border);
    user-select: none;
}

.slug-input {
    flex: 1;
    padding: 14px 16px;
    border: none;
    outline: none;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    background: var(--bg-card);
    color: var(--text-primary);
    min-width: 0;
}

.slug-status {
    font-size: 0.78rem;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.slug-status.available {
    color: var(--success);
}

.slug-status.taken {
    color: var(--error);
}

/* ---- Footer ---- */
.site-footer {
    padding: 32px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

/* ---- Public Page ---- */
.public-page-wrapper {
    min-height: 100vh;
}

.public-page-bar {
    padding: 10px 20px;
    background: var(--accent);
    color: var(--accent-text);
    text-align: center;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.public-page-bar a {
    color: var(--accent-text);
    font-weight: 600;
    text-decoration: underline;
    opacity: 0.9;
}

.public-page-bar a:hover {
    opacity: 1;
}

.public-page-content {
    padding: 0;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    html {
        font-size: 16px;
    }

    h1 {
        font-size: 2.2rem;
    }

    .hero h1 {
        font-size: 2.8rem;
    }

    .hero-features {
        grid-template-columns: 1fr;
        gap: 12px;
        max-width: 320px;
    }

    .container {
        padding: 0 24px;
    }

    .page-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-card-actions {
        width: 100%;
    }

    .page-card-actions .btn {
        flex: 1;
    }

    .dashboard-header {
        padding: 32px 0 24px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2.2rem;
    }

    .hero {
        padding: 60px 0 40px;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .header-inner {
        flex-wrap: wrap;
        gap: 12px;
    }
}

/* ---- Utility ---- */
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.gap-2 { gap: 16px; }
.hidden { display: none !important; }

/* Toggle switch */
.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--border);
    border-radius: 24px;
    transition: all var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: all var(--transition);
}

.toggle input:checked + .toggle-slider {
    background: var(--accent);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}
