/* =====================================================
   HONESTLY, E — Components
   Buttons, badges, tags, cards, forms, etc.
   ===================================================== */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 10px 20px;
    font-family: var(--font-serif);
    font-size: 15px;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

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

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

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

.btn-secondary:hover {
    background: var(--bg-hover);
}

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

.btn-danger:hover {
    background: #9B3F33;
}

.btn-danger-outline {
    background: none;
    border: 1px solid var(--error);
    color: var(--error);
}

.btn-danger-outline:hover {
    background: var(--error-light);
}

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

/* Action Bar */
.action-bar {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-family: var(--font-serif);
    font-size: 14px;
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.action-btn svg {
    width: 16px;
    height: 16px;
}

.action-btn:hover {
    border-color: var(--navy);
    color: var(--navy);
    background: white;
}

/* Journal Cards */
.journal-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.journal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.journal-card:hover {
    border-color: var(--gold);
    box-shadow: var(--shadow-sm);
}

.journal-card-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.journal-card-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}

.journal-card-meta {
    flex: 1;
}

.journal-card-date {
    font-size: 14px;
    font-weight: 500;
}

.journal-card-companion {
    font-size: 12px;
    color: var(--text-muted);
}

.journal-card-badges {
    display: flex;
    gap: var(--spacing-xs);
}

/* Written entry avatar replacement */
.journal-card-avatar-written {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.entry-detail-written-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.journal-card-title {
    font-family: var(--font-serif);
    font-size: 17px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    line-height: 1.4;
}

.journal-card-quote {
    font-size: 15px;
    font-style: italic;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: var(--spacing-md);
}

.journal-card-tags {
    display: flex;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.badge-timeline {
    background: #E8F0FE;
    color: #1A73E8;
}

.badge-written {
    background: #E8F5E9;
    color: #2E7D32;
}

.badge-edited {
    background: #FFF3E0;
    color: #E65100;
    cursor: pointer;
}

/* Tags */
.tag {
    display: inline-block;
    padding: 3px 10px;
    font-family: var(--font-sans);
    font-size: 12px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: var(--radius-full);
}

.tag-mood {
    background: rgba(197, 165, 114, 0.15);
    color: var(--gold-dark);
}

/* Forms */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    font-size: 13px;
    font-family: var(--font-sans);
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    font-family: var(--font-serif);
    font-size: 15px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    transition: border-color var(--transition-fast);
}

.form-textarea {
    resize: vertical;
    min-height: 60px;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(27, 54, 93, 0.08);
}

.form-select {
    width: 100%;
    padding: 10px 14px;
    font-family: var(--font-serif);
    font-size: 15px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    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='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.form-select:focus {
    outline: none;
    border-color: var(--navy);
}

/* Editor */
.editor-toolbar {
    display: flex;
    gap: 2px;
    padding: var(--spacing-sm);
    border: 1px solid var(--border-light);
    border-bottom: none;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    background: var(--bg-secondary);
}

.toolbar-btn {
    padding: 4px 10px;
    background: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

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

.editor-content {
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    padding: var(--spacing-md);
    border: 1px solid var(--border-light);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    background: var(--bg-card);
    font-family: var(--font-serif);
    font-size: 15px;
    line-height: 1.7;
    outline: none;
}

.editor-content:focus {
    border-color: var(--navy);
}

.editor-content:empty::before {
    content: attr(data-placeholder);
    color: var(--text-light);
}

/* Companion Grid (Picker Modal) */
.companion-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
}

.companion-grid-item {
    text-align: center;
    cursor: pointer;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.companion-grid-item:hover {
    background: var(--bg-secondary);
}

.companion-grid-item img {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    object-fit: cover;
    margin-bottom: var(--spacing-sm);
}

.companion-grid-item-name {
    font-size: 14px;
    font-weight: 500;
}

.companion-grid-item-tagline {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}

/* Reflection Options */
.reflection-options {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.reflection-option {
    display: flex;
    align-items: center;
    padding: var(--spacing-md);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.reflection-option:hover {
    border-color: var(--gold);
    background: rgba(197, 165, 114, 0.05);
}

.reflection-option.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.reflection-option.locked:hover {
    border-color: var(--border-light);
    background: none;
}

.reflection-option-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.reflection-option-title {
    font-size: 15px;
    font-weight: 500;
}

.reflection-option-desc {
    font-size: 13px;
    color: var(--text-muted);
}

.reflection-option-lock {
    font-size: 11px;
    color: var(--gold-dark);
    font-style: italic;
    margin-top: 2px;
}

/* Story Lens Grid */
.lens-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
}

.lens-option {
    text-align: center;
    padding: var(--spacing-md);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.lens-option:hover {
    border-color: var(--gold);
}

.lens-option.selected {
    border-color: var(--navy);
    background: rgba(27, 54, 93, 0.05);
}

.lens-option-icon {
    font-size: 24px;
    margin-bottom: var(--spacing-xs);
}

.lens-option-name {
    font-size: 14px;
    font-weight: 500;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--spacing-xxl) var(--spacing-lg);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: var(--spacing-md);
}

.empty-state-title {
    font-size: 20px;
    font-weight: 400;
    margin-bottom: var(--spacing-sm);
}

.empty-state-text {
    font-size: 15px;
    color: var(--text-muted);
    max-width: 320px;
    margin: 0 auto;
}

/* Audio Player */
.audio-player {
    width: 100%;
    border-radius: var(--radius-sm);
    margin-top: var(--spacing-sm);
}

/* Entry Detail */
.entry-detail-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.entry-detail-avatar {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
}

.entry-detail-meta {
    flex: 1;
}

.entry-detail-date {
    font-size: 15px;
    font-weight: 500;
}

.entry-detail-companion {
    font-size: 13px;
    color: var(--text-muted);
}

.entry-section {
    margin-bottom: var(--spacing-lg);
}

.entry-section-title {
    font-size: 12px;
    font-family: var(--font-sans);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
}

.entry-summary {
    font-size: 15px;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.6;
}

/* Inline editable fields in entry detail */
.entry-inline-edit {
    font-family: var(--font-serif);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    min-height: 32px;
    cursor: text;
}

.entry-inline-edit:hover {
    border-color: var(--border-light);
    background: var(--bg-secondary);
}

.entry-inline-edit:focus {
    outline: none;
    border-color: var(--navy);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(27, 54, 93, 0.08);
}

.entry-inline-edit:empty::before {
    content: attr(data-placeholder);
    color: var(--text-light);
    font-style: italic;
}

.entry-inline-edit[data-field="title"] {
    font-size: 18px;
    font-weight: 500;
}

.entry-inline-edit[data-field="summary"] {
    font-style: italic;
    color: var(--text-secondary);
}

.entry-section-editable .entry-section-title::after {
    content: ' (tap to edit)';
    font-weight: 400;
    font-style: italic;
    text-transform: none;
    letter-spacing: normal;
    opacity: 0.6;
    font-size: 11px;
}

.entry-transcript {
    font-size: 15px;
    line-height: 1.7;
    white-space: pre-wrap;
}

.entry-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-light);
}

/* Version History */
.version-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.version-item {
    padding: var(--spacing-md);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.version-item:hover {
    background: var(--bg-secondary);
}

.version-item-date {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.version-item-preview {
    font-size: 13px;
    color: var(--text-muted);
}

/* Delete Account Modal */
.delete-warning {
    text-align: center;
    padding: var(--spacing-md);
    background: var(--error-light);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
}

.delete-warning-icon {
    font-size: 32px;
    margin-bottom: var(--spacing-sm);
}

.delete-warning-text {
    font-size: 15px;
    color: var(--error);
    font-weight: 500;
}

.delete-instructions {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

/* PWA Banner */
.pwa-banner {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--navy);
    color: white;
    padding: var(--spacing-md) var(--spacing-lg);
    z-index: 300;
    align-items: center;
    justify-content: space-between;
}

.pwa-banner.show {
    display: flex;
}

.pwa-banner-title {
    font-size: 15px;
    font-weight: 500;
}

.pwa-banner-subtitle {
    font-size: 12px;
    opacity: 0.7;
}

.pwa-banner-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.pwa-banner-btn {
    padding: 6px 16px;
    border: none;
    border-radius: var(--radius-full);
    font-family: var(--font-serif);
    font-size: 14px;
    cursor: pointer;
}

.pwa-banner-dismiss {
    background: none;
    color: rgba(255, 255, 255, 0.7);
}

.pwa-banner-install {
    background: var(--gold);
    color: var(--navy);
    font-weight: 500;
}
