
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@500;600;700&family=Quicksand:wght@500;600;700&display=swap');

:root {
    --cork-bg: #bc8b57;
    --shadow: 4px 6px 14px rgba(0,0,0,0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    font-family: 'Quicksand', sans-serif;
    background-color: #FAF3ED;
    background-image: radial-gradient(#E8D5C4 1px, transparent 1px);
    background-size: 24px 24px;
    color: #443427;
}

h1, h2, h3, .font-header, .sidebar h2, .shop-pill-btn {
    font-family: 'Quicksand', sans-serif;
}

/* Custom Scrollbar for cozy aesthetic */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #F3E5D8;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: #D4B296;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #C39D7F;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: #EFE3D5;
    border-right: 4px solid #D8C2AD;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 4px 0 15px rgba(100, 70, 40, 0.08);
    z-index: 10;
}

.sidebar h2 {
    font-size: 1.1rem;
    color: #4a3525;
    margin-bottom: 4px;
}

.hint {
    font-size: 0.75rem;
    color: #7a6350;
    margin-bottom: 10px;
}

.weekly-log-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.weekly-log-list {
    flex: 1;
    overflow-y: auto;
    background: rgba(255,255,255,0.7);
    border-radius: 8px;
    padding: 10px;
    font-size: 0.85rem;
    border: 1px solid #e0d0b8;
}

.log-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 4px;
    border-bottom: 1px dashed rgba(0,0,0,0.1);
}

/* Corkboard Background with rich texture */
.corkboard {
    flex: 1;
    background-color: var(--cork-bg);
    background-image: 
        radial-gradient(circle, rgba(0,0,0,0.15) 1px, transparent 1px),
        radial-gradient(circle, rgba(255,255,255,0.08) 1px, transparent 1px),
        linear-gradient(135deg, rgba(0,0,0,0.1), rgba(255,255,255,0.05));
    background-size: 24px 24px, 16px 16px, 100% 100%;
    position: relative;
    padding: 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.board-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: rgba(252, 246, 235, 0.9);
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(6px);
    margin-bottom: 20px;
    z-index: 5;
    border: 2px solid #dfcca8;
}

/* Cozy Pet Box */
.cozy-pet-box {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0; /* Allows text inside to shrink naturally on narrow screens */
    flex: 1 1 auto;
}

#pet-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;
}
#pet-avatar:hover {
    transform: scale(1.15) rotate(5deg);
}

.pet-speech {
    background: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    color: #5c4033;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    border: 1px solid #ebd9bc;
    max-width: 260px;
    word-break: break-word;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Shop Pill Button */
.shop-pill-btn {
    background: #78b080;
    color: white;
    border: none;
    padding: 9px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.2);
    transition: background 0.2s, transform 0.1s;
}
.shop-pill-btn:hover {
    background: #5e9363;
    transform: scale(1.02);
}

.pill-balance {
    background: rgba(0,0,0,0.2);
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.9rem;
}

.cozy-btn {
    background: #edd1a4;
    color: #433022;
    border: none;
    padding: 9px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}
.cozy-btn:hover {
    background: #f8ddb5;
    transform: scale(1.02);
}

/* Notes Container */
.notes-container {
    flex: 1;
    position: relative;
    overflow: auto;
}

/* Sticky Notes */
.sticky-note {
    width: 182px;
    height: 182px;
    padding: 12px;
    position: absolute;
    cursor: grab;
    touch-action: none;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 2px solid transparent;
    border-radius: 16px;
    user-select: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 4px 6px 12px rgba(100, 70, 40, 0.12);
}
.sticky-note:active {
    cursor: grabbing;
}

.sticky-note.dragging {
    cursor: grabbing;
    transform: scale(1.01);
    box-shadow:
        0 20px 35px rgba(0, 0, 0, 0.30),
        0 8px 15px rgba(0, 0, 0, 0.15);
}

.sticky-note:not(.dragging):hover {
    transform: translateY(-2px) scale(1.01) rotate(0.3deg);
    box-shadow: 6px 12px 20px rgba(100, 70, 40, 0.18);
}

.sticky-note.yellow { 
    background-color: #FEF08A; 
    border-color: #FDE047; 
    color: #713F12; 
}
.sticky-note.blue { 
    background-color: #BAE6FD; 
    border-color: #7DD3FC; 
    color: #0369A1; 
}
.sticky-note.pink { 
    background-color: #FBCFE8; 
    border-color: #F472B6; 
    color: #9D174D; 
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: -8px;
}

.note-title {
    font-weight: bold;
    font-size: 0.95rem;
    word-break: break-word;
}

.delete-note-btn {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    opacity: 0.5;
    color: inherit;
    transition: opacity 0.2s;
}
.delete-note-btn:hover {
    opacity: 1;
}

.note-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-bottom: 5px;
}

.note-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.footer-controls {
    display: flex;
    align-items: center;
    gap: 6px; /* Space between the minus button and the total number */
}

.total-badge {
    font-size: 0.75rem;
    font-weight: bold;
    opacity: 0.85;
    min-width: 16px;
    text-align: center;
}

.cozy-value-tag {
    background: rgba(0, 0, 0, 0.12);
    color: inherit;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: bold;
    letter-spacing: 0.5px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.tally-display {
    font-family: monospace;
    font-size: 1.15rem;
    letter-spacing: 2px;
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px 8px;

    /* v1 soft backing box */
    background: rgba(255, 255, 255, 0.55);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    
    /* Scroll settings */
    max-height: 90px; /* Limits height so it stays inside the note */
    overflow-y: auto;  /* Adds a scrollbar only when tallies overflow */
    width: 100%;
    padding: 1px;
    scrollbar-width: thin; /* Makes the scrollbar sleek on modern browsers */
}

.tally-group {
    display: inline-block;
    white-space: nowrap;
}

.note-value {
    font-size: 0.75rem;
    opacity: 0.8;
}

.sub-tally-btn {
    background: rgba(0, 0, 0, 0.1);
    border: none;
    color: inherit;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.1s;
}

.sub-tally-btn:hover {
    background: rgba(0, 0, 0, 0.22);
    transform: scale(1.1);
}

/* Modals */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.55);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(3px);
}
.modal.hidden { display: none; }

/* Rounded Modal */
.modal-content {
    background: #FAF3ED;
    padding: 24px;
    border-radius: 24px;
    width: 420px;
    box-shadow: 0 20px 40px rgba(100, 70, 40, 0.25);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 15px;
    border: 4px solid #E2CEBC;
}

.close-btn {
    position: absolute;
    top: 15px; right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c533e;
}

.modal-content input, .modal-content select {
    padding: 10px;
    border: 1px solid #d3bd9d;
    border-radius: 8px;
    background: #fff;
}

.shop-items-list {
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shop-item-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 10px 14px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.06);
    border: 1px solid #eee;
}

/* Bounce Animation for Tally / Rewards */
@keyframes bouncePop {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}
.bounce {
    animation: bouncePop 0.25s ease;
}

.discreet-btn {
    background: #d5c5b3;
    color: #644a37;
    border: 1px solid #d8c2ad;
    padding: 4px 8px; /* Much smaller padding */
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Quicksand', sans-serif;
    font-size: 0.75rem; /* Smaller text */
    font-weight: 600;
    opacity: 0.85;
    transition: background 0.2s, opacity 0.2s;
}

.discreet-btn:hover {
    background: #e3d2bf;
    opacity: 1;
}

/* ==========================================================================
   BACK TO NOOK NAVIGATION LINK
   ========================================================================== */

.nook-nav {
    margin-bottom: 12px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background-color: #FFFEE0; /* Matching sunny cream */
    border: 1.5px solid rgba(74, 40, 0, 0.12);
    border-radius: 14px;
    color: #4A2800; /* Warm brown */
    font-family: 'Quicksand', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 2px 0 rgba(74, 40, 0, 0.08);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.back-link:hover {
    transform: translateY(-2px);
    background-color: #FFFFFF;
    box-shadow: 0 5px 0 rgba(74, 40, 0, 0.12);
}

.back-link .arrow {
    font-size: 0.95rem;
    line-height: 1;
}