@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Playfair+Display:ital,wght@0,400;0,700;1,400&display=swap');

:root {
    --paper-color: #fdfaf3;
    --ink-color: #2c2c2c;
    --dim-ink: #666;
    --accent-ink: #8b4513; 
    --font-serif: 'Libre Baskerville', serif;
    --font-heading: 'Playfair Display', serif;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-serif);
    background-color: var(--paper-color);
    color: var(--ink-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

body:has(.auth-container) {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-container, .archive-wrapper {
    width: 100%;
    max-width: 650px;
    background: transparent;
    padding: 20px;
}

h1, h2, h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    margin-top: 0;
}

.auth-container h1 {
    font-size: 2.5rem;
    text-align: center;
    border-bottom: 2px solid var(--ink-color);
    display: table;
    margin: 0 auto 1.5rem auto;
    padding-bottom: 5px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--dim-ink);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

input, textarea {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid #ccc;
    padding: 8px 0;
    font-family: var(--font-serif);
    font-size: 1.1rem;
    color: var(--ink-color);
    outline: none;
    transition: border-color 0.3s;
    resize: none;
}

input:focus, textarea:focus {
    border-bottom: 1px solid var(--ink-color);
}

.star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 10px;
}

.star-rating input {
    display: none;
}

.star-rating label {
    font-size: 1.5rem;
    color: #ccc;
    cursor: pointer;
    transition: color 0.2s;
    margin: 0;
}

.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label {
    color: #bfa058;
}

button {
    background: var(--ink-color);
    color: var(--paper-color);
    border: 1px solid var(--ink-color);
    padding: 12px 25px;
    font-family: var(--font-heading);
    font-size: 1rem;
    cursor: pointer;
    display: block;
    width: 100%;
    margin-top: 20px;
    letter-spacing: 1px;
}

button:hover {
    background: #000000;
    border-color: #000000;
}

.archive-header {
    text-align: center;
    margin-bottom: 50px;
    padding-top: 50px;
}

.archive-header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
}

.archive-entry {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.archive-entry h3 {
    margin-bottom: 5px;
    font-size: 1.5rem;
    font-style: italic;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.archive-entry .author {
    font-size: 0.9rem;
    color: var(--dim-ink);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.rating-display {
    color: #bfa058; 
    letter-spacing: 3px;
    font-size: 1.1rem;
    white-space: nowrap;
}

.progress-container {
    width: 100%;
    height: 4px;
    background: #eee;
    margin: 10px 0 20px 0;
}

.progress-bar {
    height: 100%;
    background: var(--accent-ink);
    width: 0%;
    transition: width 0.5s ease;
}

.archive-entry .thoughts {
    font-size: 1.1rem;
    text-align: justify;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.archive-entry .thoughts::first-letter {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    float: left;
    line-height: 0.8;
    padding-right: 10px;
    padding-top: 5px;
    color: var(--accent-ink);
}

.archive-entry span[onclick*="updateProgress"]:hover {
    color: #5d2e0d !important; 
}

.archive-entry span[onclick*="deleteEntry"]:hover {
    color: #600 !important; 
}

@media (max-width: 600px) {
    .archive-header h1 {
        font-size: 2rem;
    }
    .archive-entry h3 {
        font-size: 1.3rem;
    }
    .archive-entry .thoughts {
        font-size: 1rem;
    }
    .archive-entry .thoughts::first-letter {
        font-size: 2.5rem;
    }
    .main-content {
        padding: 80px 15px 120px 15px !important;
    }
}

.menu-toggle {
    position: fixed;
    top: 20px;
    left: 0;
    z-index: 1000;
    background: var(--ink-color);
    border: none;
    color: var(--paper-color);
    width: 35px;
    height: 40px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    border-radius: 0 4px 4px 0;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: var(--paper-color);
    border-right: 1px solid #ddd;
    padding: 40px 30px;
    z-index: 900;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 1024px) {
    .sidebar {
        display: none;
    }
    .main-content {
        margin-left: 0 !important;
        padding: 40px 15px 120px 15px !important;
    }
}

.main-content {
    margin-left: 280px;
    padding: 0 40px;
}

.sidebar-link {
    display: block;
    text-decoration: none;
    color: var(--ink-color);
    padding: 12px 0;
    font-size: 1rem;
    border-bottom: 1px solid transparent;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-link:hover {
    font-weight: bold;
}

.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    width: 90%;
    max-width: 500px;
    background: var(--paper-color);
    padding: 30px;
    border-radius: 4px;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--ink-color);
    color: var(--paper-color);
    padding: 12px 24px;
    font-size: 0.9rem;
    display: none;
    border-radius: 4px;
    z-index: 3000;
}

.mobile-add-btn {
    display: none;
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--ink-color);
    color: var(--paper-color);
    width: auto;
    padding: 0 25px;
    height: 50px;
    border-radius: 25px;
    z-index: 800;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    cursor: pointer;
    border: none;
}

@media (max-width: 1024px) {
    .mobile-add-btn {
        display: flex;
    }
}
