@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600&family=Inter:wght@400;500;600&display=swap');

:root{
    --paper:#f7f3ec;
    --main-text: #403A34;
    --color-pop: #7B9470;
    --color-pop-dark: #63795B;
    --paper-dark: #efe7da;
    --line:#ddd5c8;
    --delete: #b46b61;
    --delete-dark: #96574E;
    --paper-light: #fbf8f2;
    --muted-text: #7C756D;
    --radius: 14px;
    --radius-big: 20px;
    --shadow: 0 8px 22px rgba(58, 48, 39, 0.06);
    --transition: .18s ease;
    --grid: linear-gradient(rgba(255,255,255,0.5)2px, transparent 2px), linear-gradient(90deg, rgba(255,255,255,0.5) 2px, transparent 2px);
}
*{
    box-sizing: border-box;
}
body{
    font-family:'Courier New', Courier, monospace;
    margin: 0;
    min-height: 100vh;
    background: var(--paper);
    color: var(--main-text);
    background-image: var(--grid);
    background-size: 48px 48px;
}
.topbar{
    display: flex;
    justify-content: space-between;
    align-items: end;
    padding: 28px 32px;
}

h1, h2, .goal-name{
    font-family:"Cormorant Garamond", serif;
    font-weight: 600;
    color: var(--main-text);
}

h1{
    margin:0;
    font-size: 3rem;
    letter-spacing: 0.02em;
}

h2{
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.section-title{
    margin: 2.5rem 0 1.75rem;
    text-align: center;
    color: var(--muted-text);
    font-size: 1.7rem;
    font-weight: 500;
}

input, textarea{
    width: 100%;
    padding: 0.85rem 0;
    background: transparent;
    border: none;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--line);
    font: inherit;
    color: var(--main-text);
    resize: vertical;
}
input::placeholder, textarea::placeholder{
    color: var(--muted-text);
}

input:focus, textarea:focus{
    outline: none;
    border-bottom: 2px solid var(--color-pop);
}

textarea{
    min-height: 100px;
}

button{
    padding: 0.7rem 1.1rem;
    border: none;
    cursor: pointer;
    border-radius: 10px;
    background: var(--color-pop);
    color: white;
    font: inherit;
    font-weight: 600;
    transition: background var(--transition), transform var(--transition);
}
button:hover{
    transform: translateY(-1px);
    background: var(--color-pop-dark);
}

#goalContainer{
    max-width: 1000px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 1.4rem;
    margin: 0 auto;
    max-width: 1000px;
}

.create-box{
    max-width: 560px;
    padding:2rem;
    background: var(--paper-dark);
    margin: 0 auto 3rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.widget{
    position: relative;
    padding: 1.5rem;
    background: var(--paper-light);
    border:1px solid var(--line);
    box-shadow: none;
    cursor: pointer;
    border-radius: var(--radius);
    transition: transform var(--transition), border-color var(--transition);
}

.widget:hover{
    transform: translateY(-2px);
    border-color: var(--line);
}
.widget h3{
    margin: 0 0 0.45rem;
    font-family: "Cormorant Garamond", serif;
    font-size: 1.6rem;
}
.widget p{
    margin: .5rem 0;
    color: var(--muted-text);
    line-height: 1.6;
    font-size: 0.95rem;
}
.divider{
    border: none;
    width: 65%;
    margin: 3rem auto;
    border-top: 1px dashed var(--line);
}

.card-divider{
    border: none;
    border-top: 1px dashed var(--line);
}
.goal-page{
    background: var(--paper);
    position: fixed;
    inset: 0;
    overflow-y: auto;
    z-index: 100;
}
.goal-page-content{
    max-width: 900px;
    margin: auto;
    padding: 50px 41px 80px;
}

.close-btn{
    background: transparent;
    color: var(--muted-text);
    border: none;
    font-size: 16px;
    margin-bottom: 12px;
    cursor: pointer;
}

.close-btn:hover{
    color: var(--text);
}

.calendar{
    margin: 40px 0;
}

.calendar-head{
    text-align: center;
    font-weight: bold;
    color: var(--muted-text);
    padding: 6px;
}
.calendar h3{
    margin-bottom: 12px;
}
.calendar-grid{
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}
.calendar-day{
    aspect-ratio: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: transparent;
    transition: 0.2s;
}
.calendar-day:hover{
    border-color: var(--color-pop);
}
.calendar-day.completed{
     background: var(--color-pop);
     color: white;
}

.calendar-header{
    display: flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:12px;
}
.calenar-day.today{
    outline: 1px solid var(--line);
    outline-offset: -2px;
}

.calendar-header button{
    cursor: pointer;
    border: none;
    background: none;
    font-size: 25px;
    color: var(--color-pop);
}
.overlay-complete-btn{
    width: 100%;
    margin-top: 16px;
}
.delete-btn{
    width:100%;
    margin-top:10px;
    background: var(--delete);
}
.delete-btn:hover{
    background: var(--delete-dark);
}

.edit-modal{
    width: 100%;
    max-width: 500px;
    background: var(--paper-light);
    border: 1px solid var(--line);
    padding: 28px;
    box-shadow: var(--shadow);
    animation: popIn 0.2s ease;
    border-radius: 18px;
}
@keyframes popIn{
    from{
        opacity: 0;
        transform: translateY(10px) scale(.98);
    }
    to{
        opacity:1;
        transform: none;
    }
}
.edit-buttons{
    display:flex;
    gap:10px;
}
.edit-modal h2{
    margin-top: 0;
}
.edit-modal input, .edit-modal textarea{
    margin-bottom: 12px;
}
#cancelEditBtn{
    background: #ddd;
    color: #282828;
}
#cancelEditBtn:hover{
    background: #cfcfcf;
}
.goal-main{
    text-align: center;
    margin-bottom: 64px;
}

.goal-emoji{
    font-size: 45px;
    margin-bottom: 12px;
}
.goal-name{
    margin: 0;
    font-size: 30px;
}
.goal-motivation{
    margin: 16px auto;
    max-width: 600px;
    line-height:1.7;
    color: var(--muted-text);
}
.streak-card{
    text-align: center;
    margin: 30px 0;
    padding: 30px;
    background: var(--paper-dark);
    border: 1px solid var(--line);
    border-radius: 14px;
}
.streak-num{
    display: block;
    font-size: 64px;
    font-weight: 700;
    color: var(--color-pop);
}
.streak-label{
    color: var(--muted-text);
    font-size: 18px;
}
.centered-stuff{
    max-width: 960px;
    margin: 40px auto;
    padding: 40px;
    border-radius: 18px;
    background: var(--paper-light);
}

.modal-overlay{
    position: fixed;
    inset: 0;
    display: flex;
    padding: 40px;
    z-index: 9999;
    justify-content: center;
    background: rgba(0,0,0,0.35);
    align-items: center;
}

.modal-stuff{
    background: var(--paper-light);
    width: min(700px, 90vw);
    border: 1px solid var(--line);
    padding: 30px;
    border-radius: var(--radius);
    overflow-y: auto;
}

.more-actions-menu{
    position: relative;
}

.menu-btn{
    background: transparent;
    color: #777;
    font-size: 18px;
    padding: 6px 10px;
    border-radius: 10px;
    line-height: 1;
}

.menu-btn:hover{
    background: var(--paper-dark);
    transform: none;
}

.item-actions{
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.item-row:hover .item-actions{
    opacity: 1;
}
.small-btn{
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 12px;
}

.small-delete-btn{
    background: var(--delete);
}
.small-delete-btn:hover{
    background: var(--delete-dark);
}

.note-list, .message-list{
    list-style: none;
    padding: 0;
    margin: 0;
}

.item-row{
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px dashed var(--line);
    gap: 12px;
}

.menu-dropdown{
    position: absolute;
    top: 110%;
    right: 0;
    background: var(--paper-light);
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 120px;
    z-index: 1000;
}

.menu-dropdown button{
    background: transparent;
    color: #333;
    text-align: left;
    border-radius: 0;
}

.menu-dropdown button:hover{
    background: #f6f6f6;
    transform: none;
}

.delete-note-btn:hover, .delete-message-btn:hover{
    color: #d94a4a;
}

.confetti-container{
    position: fixed;
    inset:0;
    pointer-events:none;
    overflow:hidden;
    z-index:9999;
}
.confetti{
    position: fixed;
    width: 10px;
    height: 10px;
    border-radius:2px;
}
@media(max-width:600px){
    .item-actions{
        opacity: 1;
    }
}
.goal-actions{
    display: flex;
    gap: 6px;
}

.stats-card{
    margin: 40px 0;
    padding: 28px;
    background: var(--paper-light);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.stats-card h3{
    margin-top: 0;
    margin-bottom:18px;
    text-align:center;
}

.stats-row{
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px dashed var(--line);
}

.stats-row:last-child{
    border-bottom: none;
}

.stats-row strong{
    color:var(--color-pop);
}

.created-date{
    text-align: center;
    color: var(--muted-text);
    margin-top: -20px;
    margin-bottom: 31px;
    font-size: 0.95rem;
    font-style: italic;

}

.nav-tabs{
    display: flex;
    gap: 10px;
}

.nav-tabs button{
    background: transparent;
    color: var(--muted-text);
}

.nav-tabs button:hover{
    background: var(--paper-dark);
    color: var(--main-text);
}
.journal-page{
    position:fixed;
    inset: 0;
    background: var(--paper);
    overflow-y: auto;
    z-index: 200;
    background-image: var(--grid);
    background-size: 48px 48px;
}
.journal-stuff{
    max-width: 960px;
    padding: 40px;
    margin: 40px auto;
    border-radius: 18px;
    background:var(--paper-light);
}

.journal-create{
    background: var(--paper-dark);
    padding: 30px;
    border-radius:var(--radius);
    margin-bottom: 40px;
    border: 1px solid var(--line);
}

.journal-entry{
    background: var(--paper-light);
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    margin-bottom: 20px;
    overflow: hidden;
}

.journal-date{
    color: var(--muted-text);
    font-size: 0.9rem;
}

.journal-entry h3{
    font-family: "Cormorant Garamond", serif;
    font-size:1.8rem;
}

.complete-btn.completed, .overlay-complete-btn.completed{
    background: #b9b9b9;
    cursor: default;
}

.complete-btn.completed:hover, .overlay-complete-btn.completed:hover{
    transform: none;
    background: #b9b9b9;
}

.complete-btn:disabled{
    cursor: default;
    opacity: 1;
}

.add-new-btn{
    margin: 30px auto;
    display: flex;
}

 .journal-preview{
    line-height: 1.6;
    margin-top: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    display: box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    word-break: break-word;
    overflow-wrap: anywhere;
}

#journalViewText{
    white-space: pre-wrap;
    overflow-wrap: break-word;
    word-break: break-word;
    line-height: 1.7;
}
.calendar-header button:disabled{
    opacity: 0.35;
    cursor: not-allowed;
}

.calendar{
    animation: calendarFade 0.2s ease;
}

.goal-topbar{
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

@keyframes calendarFade{
    from{
        opacity: 0;
        transform: translateX(17px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}



.hidden{
    display: none;
}