/* ==========================================================================
   DAILY REFLECTION JOURNAL STYLES
   ========================================================================== */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 20px 24px 40px;
    min-height: 100vh;
    font-family: 'Quicksand', sans-serif;
    color: #4A2800;
    transition: background-color 0.3s ease;
}

/* ==========================================================================
   PAPER TONE THEMES
   ========================================================================== */
body.paper-cream { background-color: #FAF5E8; }
body.paper-sage  { background-color: #E8F0E8; }
body.paper-blush { background-color: #FCECEF; }
body.paper-sky   { background-color: #E9F3FB; }

/* Font Styles */
body.font-quicksand #journal-textarea,
body.font-quicksand .prompt-text {
    font-family: 'Quicksand', sans-serif;
}

body.font-caveat #journal-textarea,
body.font-caveat .prompt-text {
    font-family: 'Caveat', cursive;
    font-size: 1.55rem;
    line-height: 1.5;
}

body.font-dancing #journal-textarea,
body.font-dancing .prompt-text {
    font-family: 'Dancing Script', cursive;
    font-size: 1.5rem;
    line-height: 1.6;
}

body.font-lora #journal-textarea,
body.font-lora .prompt-text {
    font-family: 'Lora', serif;
    line-height: 1.7;
}

/* Back Link Navigation */
.nook-nav {
    margin-bottom: 20px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    background-color: #FFFEE0;
    border: 1.5px solid rgba(74, 40, 0, 0.12);
    border-radius: 14px;
    color: #4A2800;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 2px 0 rgba(74, 40, 0, 0.08);
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.back-link:hover {
    transform: translateY(-1px);
    background-color: #FFFFFF;
}

/* ==========================================================================
   APP LAYOUT
   ========================================================================== */
.journal-app-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 32px;
    max-width: 1050px;
    margin: 0 auto;
}

/* Sidebar */
.journal-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* My Journal Book Button */
.journal-book-card {
    background: #6A4B62;
    border: none;
    border-radius: 16px;
    padding: 20px 16px;
    cursor: pointer;
    box-shadow: 0 6px 0 #462F41, 0 10px 15px rgba(74, 40, 0, 0.15);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    text-align: center;
}

.journal-book-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 0 #5E3322, 0 12px 18px rgba(74, 40, 0, 0.18);
}

.book-cover {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: #FFFDF0;
}

.book-icon { font-size: 2.2rem; }
.book-title { font-size: 1.1rem; font-weight: 800; font-family: 'Quicksand', sans-serif; }
.entry-count-badge { font-size: 0.78rem; opacity: 0.85; font-weight: 500; }

/* Sidebar Utility Box */
.sidebar-box {
    background: rgba(255, 255, 255, 0.65);
    border: 1.5px solid rgba(74, 40, 0, 0.1);
    border-radius: 16px;
    padding: 16px;
}

.sidebar-box h3 {
    margin: 0 0 10px 0;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.75;
}

/* Tone Buttons */
.tone-picker {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.tone-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.tone-btn:hover { transform: scale(1.1); }
.tone-btn.active { border-color: #4A2800; }

.tone-cream { background-color: #FAF5E8; }
.tone-sage  { background-color: #E8F0E8; }
.tone-blush { background-color: #FCECEF; }
.tone-sky   { background-color: #E9F3FB; }

/* Font Picker */
.font-picker {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.font-btn {
    background: transparent;
    border: 1px solid rgba(74, 40, 0, 0.15);
    border-radius: 8px;
    padding: 6px 10px;
    font-family: 'Quicksand', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    color: #4A2800;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
}

.font-btn:hover, .font-btn.active {
    background: #FFFEE0;
    border-color: rgba(74, 40, 0, 0.3);
}

/* Backup Links */
.backup-title {
    font-size: 0.78rem;
    margin: 0 0 6px 0;
    font-weight: 700;
    opacity: 0.6;
}

.backup-links {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
}

.text-link-btn {
    background: none;
    border: none;
    padding: 0;
    color: #4A2800;
    text-decoration: underline;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.78rem;
    opacity: 0.7;
}

.text-link-btn:hover { opacity: 1; }

/* ==========================================================================
   MAIN WRITING CANVAS
   ========================================================================== */
.journal-writing-area {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Prompt Banner */
.prompt-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255, 255, 255, 0.75);
    border: 1.5px solid rgba(74, 40, 0, 0.12);
    border-radius: 20px;
    padding: 12px 18px;
    box-shadow: 0 3px 6px rgba(74, 40, 0, 0.04);
}

.cat-avatar {
    background: #FFFEE0;
    border: 1.5px solid rgba(74, 40, 0, 0.15);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    flex-shrink: 0;
}

.cat-avatar:hover {
    transform: scale(1.15) rotate(5deg);
}

.prompt-content {
    display: flex;
    flex-direction: column;
}

.prompt-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.5px;
    opacity: 0.5;
}

.prompt-text {
    margin: 2px 0 0 0;
    font-size: 0.98rem;
    font-weight: 700;
}

/* Date Header */
.entry-date-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 2px dashed rgba(74, 40, 0, 0.15);
    padding-bottom: 8px;
}

.entry-date-header h1 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 800;
}

.save-status {
    font-size: 0.8rem;
    font-weight: 700;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

/* Paper Textarea */
.paper-editor-container {
    width: 100%;
}

#journal-textarea {
    width: 100%;
    min-height: 420px;
    background: transparent;
    border: none;
    outline: none;
    resize: vertical;
    font-size: 1.15rem;
    color: #4A2800;
    line-height: 1.8;
    padding: 8px 0;
}

/* ==========================================================================
   MODAL OVERLAY (MY JOURNAL BOOK)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(74, 40, 0, 0.35);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.modal-overlay.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.journal-modal-paper {
    background: #FAF5E8;
    border: 2px solid rgba(74, 40, 0, 0.15);
    border-radius: 20px;
    width: 90%;
    max-width: 680px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    padding: 24px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(74, 40, 0, 0.1);
    padding-bottom: 12px;
}

.modal-header h2 { margin: 0; font-size: 1.3rem; }

.close-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #4A2800;
}

.modal-body {
    overflow-y: auto;
    padding-top: 16px;
}

/* ==========================================================================
   PAST ENTRY CARD SCRAPBOOK THEMES
   ========================================================================== */
.past-entry-card {
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 16px;
    border: 1px solid rgba(74, 40, 0, 0.12);
    box-shadow: 0 2px 6px rgba(74, 40, 0, 0.04);
    transition: transform 0.15s ease;
}

/* Past Entry Paper Tone Backgrounds */
.past-entry-card.paper-cream { background-color: #FAF5E8; }
.past-entry-card.paper-sage  { background-color: #E8F0E8; }
.past-entry-card.paper-blush { background-color: #FCECEF; }
.past-entry-card.paper-sky   { background-color: #E9F3FB; }

/* Past Entry Font Styles */
.past-entry-card.font-quicksand .past-entry-text,
.past-entry-card.font-quicksand .past-entry-prompt {
    font-family: 'Quicksand', sans-serif;
}

.past-entry-card.font-caveat .past-entry-text,
.past-entry-card.font-caveat .past-entry-prompt {
    font-family: 'Caveat', cursive;
    font-size: 1.45rem;
    line-height: 1.4;
}

.past-entry-card.font-dancing .past-entry-text,
.past-entry-card.font-dancing .past-entry-prompt {
    font-family: 'Dancing Script', cursive;
    font-size: 1.4rem;
    line-height: 1.5;
}

.past-entry-card.font-lora .past-entry-text,
.past-entry-card.font-lora .past-entry-prompt {
    font-family: 'Lora', serif;
    line-height: 1.6;
}

.past-entry-date {
    font-size: 0.82rem;
    font-weight: 800;
    opacity: 0.6;
    margin-bottom: 6px;
}

.past-entry-prompt {
    font-size: 0.88rem;
    opacity: 0.75;
    margin-bottom: 8px;
    font-style: italic;
}

.past-entry-text {
    white-space: pre-wrap;
    font-size: 1.05rem;
    line-height: 1.6;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .journal-app-layout {
        grid-template-columns: 1fr;
    }
}

/* Past Entry Header with Delete Action */
.past-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.past-entry-header .past-entry-date {
    margin-bottom: 0;
}

.delete-entry-btn {
    background: none;
    border: none;
    font-size: 0.9rem;
    cursor: pointer;
    opacity: 0.4;
    padding: 2px 6px;
    border-radius: 6px;
    transition: opacity 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.delete-entry-btn:hover {
    opacity: 1;
    background-color: rgba(192, 78, 45, 0.12);
    transform: scale(1.1);
}