/* Connect - Warm, uitnodigend design voor relatie-verbinding */

:root {
    --accent: #8B5E3C;
    --accent-light: #C4956A;
    --accent-soft: #F5EDE4;
    --bg: #FDF8F4;
    --card-bg: #FFFFFF;
    --text-primary: #2C1810;
    --text-secondary: #7A6B63;
    --border-color: #E8DDD5;
    --success: #4CAF50;
    --error: #E57373;
    --shadow: 0 2px 12px rgba(139, 94, 60, 0.08);
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    min-height: 100dvh;
}

/* App Layout */
.app-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

/* Header */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-brand {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.header-nav {
    display: flex;
    gap: 4px;
}

.nav-link {
    padding: 8px 16px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-link:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.nav-link.active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}

.logout-link {
    color: var(--text-secondary);
    font-size: 13px;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 24px 20px;
    max-width: 640px;
    margin: 0 auto;
    width: 100%;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 12px;
}

/* Page Container */
.page-container {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Page Title */
.page-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.page-subtitle {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 15px;
}

/* Question Card */
.question-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 32px 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    text-align: center;
}

.question-category {
    display: inline-block;
    background: var(--accent-soft);
    color: var(--accent);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: capitalize;
    margin-bottom: 16px;
}

.question-text {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
}

/* Article Card */
.article-card {
    background: linear-gradient(135deg, #F5EDE4 0%, #FFFFFF 100%);
    border-radius: 16px;
    padding: 28px 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    border-left: 4px solid var(--accent-light);
}

.article-badge {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
    margin-bottom: 12px;
}

.article-title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.article-content {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-primary);
}

.article-content p {
    margin-bottom: 12px;
}

.article-content p:last-child {
    margin-bottom: 0;
}

/* Answer Section */
.answer-section {
    margin-top: 8px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.answer-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}

.answer-card strong {
    color: var(--accent);
    font-size: 14px;
    display: block;
    margin-bottom: 4px;
}

.answer-card p {
    color: var(--text-primary);
    line-height: 1.5;
}

/* Answer Form */
.answer-form-section {
    margin-top: 24px;
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.answer-form-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.person-select {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.person-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.person-option:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

.person-option input {
    display: none;
}

.answer-textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    background: var(--bg);
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.answer-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.submit-button {
    width: 100%;
    padding: 14px;
    margin-top: 12px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
}

.submit-button:hover {
    opacity: 0.9;
}

.submit-button:active {
    transform: scale(0.98);
}

/* Edit answer */
.edit-answer-button {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding: 4px 14px;
    border-radius: 16px;
    cursor: pointer;
    margin-top: -4px;
    margin-bottom: 4px;
    transition: all 0.2s;
}

.edit-answer-button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.edit-form-buttons {
    display: flex;
    gap: 8px;
}

.edit-form-buttons .submit-button {
    flex: 1;
}

.cancel-button {
    flex: 0 0 auto;
    padding: 12px 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.cancel-button:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

/* Passkey setup */
.passkey-setup {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.passkey-setup-button {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.passkey-setup-button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.passkey-status {
    font-size: 0.85rem;
    margin-top: 8px;
    min-height: 20px;
    color: var(--text-secondary);
}

.passkey-success {
    color: var(--success);
}

.passkey-error {
    color: var(--error);
}

/* Waiting message */
.waiting-message {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 16px;
    background: var(--accent-soft);
    border-radius: 12px;
    margin-top: 12px;
    font-size: 14px;
}

/* Messages */
.message-success {
    background: #E8F5E9;
    color: #2E7D32;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 500;
}

.message-error {
    background: #FFEBEE;
    color: #C62828;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 500;
}

/* History */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.history-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.history-date {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.history-category {
    display: inline-block;
    background: var(--accent-soft);
    color: var(--accent);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.history-question {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.4;
}

.history-answers {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-answer {
    padding: 10px 14px;
    background: var(--bg);
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.history-answer strong {
    color: var(--accent);
    margin-right: 6px;
}

.no-answers {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 14px;
}

.history-article-badge {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.history-article-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 8px;
    padding-left: 12px;
    border-left: 3px solid var(--accent-light);
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.category-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px 16px;
    box-shadow: var(--shadow);
    text-decoration: none;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(139, 94, 60, 0.15);
}

.category-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.category-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: capitalize;
}

/* Questions List */
.questions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.question-list-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: var(--shadow);
}

.question-list-text {
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.5;
}

/* Back Link */
.back-link {
    display: inline-block;
    color: var(--accent);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
}

.back-link:hover {
    text-decoration: underline;
}

/* Program Day Badge */
.program-day-badge {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 20px;
}

.program-concept {
    font-size: 14px;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 16px;
    line-height: 1.4;
}

/* Program Article Content — rich HTML */
.program-article-content h2 {
    font-size: 18px;
    font-weight: 700;
    margin-top: 24px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.program-article-content h3 {
    font-size: 16px;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.program-article-content blockquote {
    border-left: 3px solid var(--accent-light);
    margin: 16px 0;
    padding: 12px 16px;
    background: var(--accent-soft);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--text-primary);
    line-height: 1.6;
}

.program-article-content hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 24px 0;
}

.program-article-content p {
    margin-bottom: 12px;
    line-height: 1.7;
}

.program-article-content p:last-child {
    margin-bottom: 0;
}

/* Exercise Card */
.exercise-card {
    background: linear-gradient(135deg, #E8F5E9 0%, #FFFFFF 100%);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    border-left: 4px solid var(--success);
}

.exercise-label {
    display: inline-block;
    background: var(--success);
    color: white;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

.exercise-card .article-content h2 {
    font-size: 16px;
    font-weight: 700;
    margin-top: 16px;
    margin-bottom: 8px;
}

.exercise-card .article-content p {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 8px;
}

/* Next Day Section */
.next-day-section {
    margin-top: 20px;
    text-align: center;
}

.next-day-button {
    display: inline-block;
    padding: 14px 32px;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
    width: 100%;
}

.next-day-button:hover {
    opacity: 0.9;
}

.next-day-button:active {
    transform: scale(0.98);
}

/* History Program Badge */
.history-program-badge {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s;
}

.history-program-badge:hover {
    opacity: 0.85;
}

.history-question-link {
    text-decoration: none;
    color: inherit;
}

.history-question-link:hover .history-question {
    color: var(--accent);
}

/* Program Overview */
.program-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.program-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s, box-shadow 0.15s;
    position: relative;
}

.program-item-completed:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(139, 94, 60, 0.12);
}

.program-item-current {
    border: 2px solid var(--accent);
    background: var(--accent-soft);
}

.program-item-current:hover {
    transform: translateY(-1px);
}

.program-item-locked {
    opacity: 0.45;
    cursor: default;
}

.program-item-day {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    color: white;
    background: var(--accent);
}

.program-item-locked .program-item-day {
    background: var(--text-secondary);
}

.program-item-content {
    flex: 1;
    min-width: 0;
}

.program-item-theme {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.program-item-concept {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.program-item-exercise-dot {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success);
}

/* HTMX loading indicator */
.htmx-request .submit-button {
    opacity: 0.6;
    cursor: wait;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .app-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .header-nav {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .nav-link {
        padding: 6px 12px;
        font-size: 13px;
    }

    .main-content {
        padding: 16px;
    }

    .question-card {
        padding: 24px 16px;
    }

    .question-text {
        font-size: 18px;
    }

    .article-card {
        padding: 20px 16px;
    }

    .article-title {
        font-size: 18px;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .category-card {
        padding: 20px 12px;
    }
}
