:root {
    /* Neutral Colors */
    --driftwood-0: #ffffff;
    --driftwood-1: #fafaf9;
    --driftwood-2: #f5f5f4;
    --driftwood-3: #e7e5e4;
    --driftwood-4: #d6d3d1;
    --driftwood-5: #a8a29e;
    --driftwood-6: #78716c;
    --driftwood-7: #57534e;
    --driftwood-8: #44403c;
    --driftwood-9: #292524;
    --driftwood-10: #1c1917;
    --driftwood-11: #0c0a09;

    --red: #ff6b6b;
    --green: #2ba84a;

    --font-size-displayLarge: 52px;
    --font-size-displayMedium: 46px;
    --font-size-displaySmall: 41px;
    --font-size-heading1: 36px;
    --font-size-heading2: 32px;
    --font-size-heading3: 29px;
    --font-size-heading4: 26px;
    --font-size-heading5: 23px;
    --font-size-heading6: 20px;
    --font-size-subtitle: 18px;
    --font-size-body: 16px;
    --font-size-caption: 14px;
    --font-size-label: 13px;
    --font-size-tagline: 11px;
}



body {
    font-family: 'Inter', sans-serif;
    background-color: var(--driftwood-1);
    color: var(--driftwood-11);
    margin: 0;
    padding: 0;
    font-optical-sizing: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.toolbar {
    position: sticky;
    top: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    padding: 12px 16px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    z-index: 100;
    font-size: var(--font-size-caption);
}

.toolbar-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toolbar select {
    padding: 0 12px 0 0;
    font-size: var(--font-size-caption);
    background: none;
    border: none;
    outline: none;
    cursor: pointer;
    color: var(--driftwood-10);
    width: fit-content;
}

label,
button {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    font-size: var(--font-size-caption);
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
}


.toolbar button {
    border: none;
    cursor: pointer;
    transition: color 0.2s;
    color: var(--driftwood-8);
}

.toolbar button:hover {
    color: var(--driftwood-12);
}

main#content-container {
    max-width: 750px;
    margin: 48px auto;
    padding: 0;
    font-size: var(--font-size-subtitle);
    line-height: 1.6;
}

#search-input {
    font-size: var(--font-size-caption);
    padding: 6px 12px;
    background: none;
    outline: none;
    border: none;
    max-width: 100px;
}

#search-next,
#search-prev {
    background: none;
    border: none;
    padding: 0 8px;
    color: var(--driftwood-6);
}

#search-next:hover,
#search-prev:hover {
    color: var(--driftwood-12);
}

/* Enhanced Search Group */
.search-group {
    gap: 4px;
}

.entry {
    margin-bottom: 64px;
}

.date-head {
    padding: 24px 24px 20px;
    border-bottom: 1px solid var(--driftwood-2);
}

.date-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.delete-entry-btn {
    background: var(--red);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: var(--font-size-subtitle);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.entry h1:hover .delete-entry-btn {
    opacity: 1;
}

.delete-entry-btn:hover {
    background: #cc0000;
}

h1 {
    font-size: var(--font-size-heading3);
    font-weight: 600;
    color: var(--driftwood-11);
    margin: 0;
    padding: 0;
}

.counts {
    font-size: var(--font-size-caption);
    color: var(--driftwood-5);
    margin-bottom: 0;
    font-family: 'Google Sans Code', monospace;
}

.editable-content {
    outline: none;
    border: none;
    margin: 0;
    padding: 24px;
    border-radius: 16px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

.editable-content:focus {
    background-color: var(--driftwood-1);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
    transform: translateY(-1px);
}

mark.highlight {
    background-color: yellow;
    color: black;
}

/* --- Add these new styles to the bottom of your style.css file --- */

/* Save Status Alert */
#save-status {
    color: #4CAF50;
    /* A nice green color */
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

#save-status.visible {
    opacity: 1;
}

/* Dropdown Menu Styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    /* Hidden by default */
    position: absolute;
    right: 0;
    background-color: var(--driftwood-1);
    min-width: 170px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.07);
    z-index: 100;
    border-radius: 12px;
    padding: 5px 0;
    border: 1px solid var(--driftwood-1);
}

/* Style for buttons inside the dropdown */
.dropdown-content button {
    color: var(--driftwood-12);
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: var(--font-size-caption);
    border-radius: 0;
    background-color: var(--driftwood-1);
    outline: none;
    white-space: nowrap;
    transition: background-color 0.2s;
    width: 100%;
}

.dropdown-content button:hover {
    background-color: var(--driftwood-2);
}

/* A simple separator line */
.dropdown-content hr {
    margin: 5px 0;
    border: 0;
    border-top: 1px solid #eee;
}

.dropdown-content.show {
    display: block;
}

mark.highlight.active {
    background-color: #ff9800;
    /* Orange for the active one */
    outline: 1px solid #c67600;
}

/* Danger button style for 'Clear Data' */
.dropdown-content button.danger {
    color: var(--driftwood-12);
    font-weight: 600;
}

.dropdown-content button.danger:hover {
    color: #d9534f;
}

/* --- Add these new styles for the modal to the bottom of your style.css file --- */

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none;
    /* Hidden by default */
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-overlay.show {
    display: flex;
    /* Shown with JavaScript */
}

.modal-content {
    background: white;
    padding: 25px 30px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    max-width: 450px;
    text-align: center;
    animation: fadeIn 0.3s ease-out;
}

.modal-title {
    font-size: 1.2em;
    margin-top: 0;
}

.modal-actions {
    margin-top: 25px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.modal-actions button {
    padding: 10px 20px;
    border-radius: 5px;
    border: 1px solid #ddd;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.modal-actions button.danger {
    background-color: #d9534f;
    color: white;
    border-color: #d9534f;
}

.modal-actions button.danger:hover {
    background-color: #c9302c;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}


/* --- Add these new styles to the bottom of your style.css file --- */

/* Notification Styles */
#notification-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    padding: 12px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: white;
    font-weight: 500;
    animation: slideIn 0.3s ease-out, fadeOut 0.5s ease-in-out 3s forwards;
}

.notification.success {
    background-color: var(--green);
}

.notification.error {
    background-color: var(--red);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

/* --- Add these styles for the Icon Picker to your style.css file --- */
.icon-picker {
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    gap: 4px;
}

.icon-picker.visible {
    display: flex;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.icon-btn:hover {
    background-color: #f0f0f0;
}

/* "Hide Empty" Toggle Styles */
.dropdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    font-size: 14px;
}

.toggle-switch {
    position: relative;
    width: 40px;
    height: 22px;
    -webkit-appearance: none;
    appearance: none;
    background: #ccc;
    outline: none;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.toggle-switch::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}

.toggle-switch:checked {
    background-color: #4CAF50;
}

.toggle-switch:checked::before {
    transform: translateX(18px);
}

/* Minor tweak to editable area */
.editable-content {
    outline: none;
}

@media (max-width: 1024px) {

    /* Solution: Make your selector more specific */
    body input[type="range" i] {
        width: 80px !important;
    }
}



@media (max-width: 768px) {


    .toolbar-section {
        gap: 8px;
    }
}

@media (max-width: 510px) {

    /* Solution: Make your selector more specific */
    body input[type="range" i] {
        width: 64px !important;
    }

    .toolbar-section {
        gap: 8px;
        width: 100%;
        flex-wrap: nowrap;
        justify-content: space-between;
    }
}