/**
 * True Heart - Components
 * Cards, buttons, forms, and reusable UI elements
 */

/* ============================================
   CARDS
   ============================================ */

.card {
    background: var(--th-bg-primary);
    border-radius: var(--th-radius-xl);
    box-shadow: var(--th-shadow-lg);
    padding: 40px 32px;
    margin-bottom: 20px;
}

.daily-focus-card {
    background: var(--th-bg-primary);
    border: 2px solid var(--th-border);
    border-radius: var(--th-radius-xl);
    padding: 32px 28px;
    margin-bottom: 32px;
    box-shadow: var(--th-shadow-sm);
}

.entry-card,
.prompt-card {
    background: var(--th-bg-primary);
    border: 2px solid var(--th-border);
    border-radius: var(--th-radius-lg);
    padding: 20px;
    margin-bottom: 12px;
    transition: all var(--th-transition-fast);
    cursor: pointer;
}

.entry-card:hover,
.prompt-card:hover {
    border-color: var(--th-primary);
    transform: translateY(-2px);
    box-shadow: var(--th-shadow-md);
}

/* ============================================
   NEW USER MODAL
   ============================================ */

#newUserModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.num-card {
    background: var(--th-bg-primary);
    border-radius: var(--th-radius-xl);
    box-shadow: var(--th-shadow-lg);
    padding: 40px 32px;
    max-width: 500px;
    width: 90%;
    text-align: center;
}

.num-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 16px;
}

.num-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--th-text-primary);
}

.num-body {
    font-size: 16px;
    color: var(--th-text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

.num-btn {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: var(--th-radius-md);
    cursor: pointer;
    background: var(--th-primary);
    color: white;
    transition: all var(--th-transition-fast);
}

.num-btn:hover:not(:disabled) {
    background: var(--th-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(62, 207, 207, 0.3);
}

.num-btn:disabled {
    background: var(--th-text-light);
    cursor: not-allowed;
    opacity: 0.6;
}

/* ============================================
   BUTTONS (Glimmer-Ready)
   ============================================ */

.btn {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: var(--th-radius-md);
    cursor: pointer;
    transition: all var(--th-transition-fast);
    -webkit-appearance: none;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--th-primary);
    color: white;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    background: var(--th-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(62, 207, 207, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: var(--th-text-light);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: var(--th-bg-secondary);
    color: var(--th-text-primary);
}

.btn-secondary:hover {
    background: var(--th-bg-tertiary);
    transform: translateY(-1px);
}

.btn-chat-start {
    display: block;
    width: 100%;
    margin-top: 0;
    margin-bottom: 45px;
    padding: 28px 24px;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    color: #0d1117 !important;
    background: #1a8a8a !important;
    border: none;
    border-radius: var(--th-radius-md);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(62, 207, 207, 0.3);
    letter-spacing: 0.03em;
    transition: all 0.2s ease;
    font-family: inherit;
    -webkit-appearance: none;
}

.btn-chat-start:hover {
    background: var(--th-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(62, 207, 207, 0.45);
    color: white;
    text-decoration: none;
}

.btn-chat-start:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(62, 207, 207, 0.3);
}

.save-btn,
.back-btn {
    background: transparent;
    border: none;
    color: var(--th-primary);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--th-radius-sm);
    transition: all var(--th-transition-fast);
}

.save-btn:hover,
.back-btn:hover {
    background: var(--th-bg-secondary);
}

.action-btn {
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    border-radius: var(--th-radius-sm);
    cursor: pointer;
    transition: all var(--th-transition-fast);
    background: transparent;
}

.view-btn {
    color: var(--th-primary);
}

.view-btn:hover {
    background: rgba(62, 207, 207, 0.1);
}

.delete-btn {
    color: var(--th-error);
}

.delete-btn:hover {
    background: var(--th-error-bg);
}

/* ============================================
   FORMS
   ============================================ */

.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--th-text-secondary);
    margin-bottom: 8px;
}

input[type="email"],
input[type="password"],
input[type="text"],
textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid var(--th-border);
    border-radius: var(--th-radius-md);
    background: var(--th-bg-secondary);
    color: var(--th-text-primary);
    transition: all var(--th-transition-fast);
    -webkit-appearance: none;
    font-family: inherit;
}

input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--th-primary);
    background: var(--th-bg-primary);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.writing-area textarea {
    width: 100%;
    min-height: 400px;
    padding: 20px;
    font-size: 16px;
    line-height: 1.6;
    border: 2px solid var(--th-border);
    border-radius: var(--th-radius-lg);
    background: var(--th-bg-primary);
}

/* ============================================
   PASSWORD STRENGTH
   ============================================ */

.password-strength {
    margin-top: 8px;
    height: 4px;
    background: var(--th-border);
    border-radius: 2px;
    overflow: hidden;
    display: none;
}

.password-strength.visible {
    display: block;
}

.password-strength-bar {
    height: 100%;
    width: 0%;
    transition: all var(--th-transition-base);
    border-radius: 2px;
}

.password-strength-bar.weak {
    width: 33%;
    background: var(--th-error);
}

.password-strength-bar.medium {
    width: 66%;
    background: var(--th-warning);
}

.password-strength-bar.strong {
    width: 100%;
    background: var(--th-success);
}

/* ============================================
   MOOD SELECTOR
   ============================================ */

.mood-options {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.mood-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    background: var(--th-bg-primary);
    border: 2px solid var(--th-border);
    border-radius: var(--th-radius-md);
    cursor: pointer;
    transition: all var(--th-transition-fast);
    min-width: 70px;
}

.mood-btn:hover {
    border-color: var(--th-primary-light);
    transform: translateY(-2px);
}

.mood-btn.selected {
    border-color: var(--th-primary);
    background: rgba(62, 207, 207, 0.1);
}

.mood-emoji {
    font-size: 28px;
}

.mood-label {
    font-size: 11px;
    color: var(--th-text-primary);
    white-space: nowrap;
}

/* ============================================
   FOCUS OPTIONS (Profile)
   ============================================ */

.focus-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.focus-option {
    display: flex;
    align-items: flex-start;
    padding: 20px;
    background: var(--th-bg-secondary);
    border: 2px solid var(--th-border);
    border-radius: var(--th-radius-md);
    cursor: pointer;
    transition: all var(--th-transition-fast);
}

.focus-option:hover {
    background: var(--th-bg-primary);
    border-color: var(--th-primary-light);
}

.focus-option:has(input:checked) {
    background: rgba(62, 207, 207, 0.05);
    border-color: var(--th-primary);
}

.focus-option input[type="radio"] {
    margin-top: 2px;
    margin-right: 16px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--th-primary);
}

/* ============================================
   MESSAGES
   ============================================ */

.message {
    padding: 12px 16px;
    border-radius: var(--th-radius-sm);
    font-size: 14px;
    margin-bottom: 20px;
    display: none;
}

.message.visible {
    display: block;
}

.error-message {
    background: var(--th-error-bg);
    border: 1px solid var(--th-error-border);
    color: var(--th-error);
}

.success-message {
    background: var(--th-success-bg);
    border: 1px solid var(--th-success-border);
    color: #065F46;
}

/* ============================================
   LOADING STATE
   ============================================ */

.loading {
    display: none;
    text-align: center;
    color: var(--th-text-light);
    font-size: 14px;
    margin-top: 12px;
}

.loading.visible {
    display: block;
}

/* ============================================
   EMPTY STATES
   ============================================ */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--th-text-secondary);
}

.empty-state .empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    color: var(--th-text-light);
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 500;
    color: var(--th-text-primary);
    margin-bottom: 8px;
}

.empty-state .btn {
    width: auto;
    padding: 14px 32px;
}

/* ============================================
   PROMPT DISPLAY
   ============================================ */

.prompt-display {
    background: var(--th-bg-primary);
    border: 1px solid var(--th-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    color: var(--th-text-primary);
    padding: 24px;
    border-radius: var(--th-radius-lg);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

body.light-mode .prompt-display {
    background: var(--th-bg-primary);
    border-color: var(--th-border);
}

.focus-prompt {
    font-size: 22px;
    line-height: 1.5;
    color: var(--th-text-primary);
    margin-bottom: 28px;
    font-weight: 400;
    min-height: 66px;
    display: flex;
    align-items: center;
}

/* ============================================
   QUICK ACTIONS
   ============================================ */

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.action-card {
    background: var(--th-bg-primary);
    border: 2px solid var(--th-border);
    border-radius: var(--th-radius-lg);
    padding: 20px 16px;
    text-align: center;
    text-decoration: none;
    transition: all var(--th-transition-fast);
}

.action-card:hover {
    border-color: var(--th-primary);
    transform: translateY(-2px);
    box-shadow: var(--th-shadow-md);
}

/* Blueprint action card – highlight border when ready / complete */
.action-card-blueprint {
    border-color: var(--th-primary);
}

.action-card-blueprint .bp-countdown {
    font-size: 0.9rem;
    color: var(--th-primary);
    letter-spacing: 0.02em;
}

/* Locked (time_lock) state — not a link, muted look */
.action-card.action-card-locked {
    cursor: default;
    opacity: 0.72;
}

.action-card.action-card-locked:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--th-border);
}

/* ============================================
   LOGO & BRANDING
   ============================================ */

.logo {
    text-align: center;
    margin-bottom: 32px;
}

.logo h1 {
    font-family: var(--th-font-serif);
    font-size: 32px;
    font-weight: 300;
    color: var(--th-text-primary);
    letter-spacing: 0.12em;
}
.logo h1 em {
    font-style: italic;
    color: var(--th-primary);
}

.logo p {
    font-size: 14px;
    color: var(--th-text-light);
    margin-top: 8px;
}

/* ============================================
   FOOTER LINKS
   ============================================ */

.footer-links {
    text-align: center;
    padding: 20px;
}

.footer-links a {
    color: var(--th-text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color var(--th-transition-fast);
}

.footer-links a:hover {
    color: var(--th-primary);
}

.footer-links-auth {
    padding-top: 12px;
}

.footer-links-auth .footer-links-label {
    font-size: 14px;
    color: var(--th-text-light);
    margin: 0 0 12px;
}

.footer-links-auth .footer-cta-btn {
    display: block;
    max-width: 320px;
    margin: 0 auto;
    text-decoration: none;
    font-size: 16px;
    color: var(--th-text-primary);
}

.footer-links-auth .footer-cta-btn:hover {
    color: var(--th-text-primary);
}