:root {
    --nl-bg-light: #ffffff;
    --nl-text-light: #333333;
    --nl-card-bg-light: #f9f9f9;
    /* ... other light variables ... */
}

html.dark {
    --nl-bg-light: #1a202c; /* Use dark value */
    --nl-text-light: #e0e0e0;
    --nl-card-bg-light: #2d3748;
    /* ... override other variables ... */
}

/* Style elements using variables */
body {
    /* Or specific containers in notelist */
    background-color: var(--nl-bg-light);
    color: var(--nl-text-light);
    transition:
        background-color 0.3s,
        color 0.3s;

}

/* mindmap-custom.css OR your notelist CSS file */
main {
    /* Or a more specific selector for the container of #notes-grid if 'main' is too broad */
    touch-action: pan-y;
    /* Ensure it's scrollable */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* For smoother scrolling on iOS */
}

main.custom-scrollbar {
    /* Example using classes from your JS */
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch; /* Keep for iOS momentum */
    /* Ensure overflow is set (likely done via Tailwind 'overflow-y-auto') */
    overflow-y: auto;
}

.note-card {
    /* Other existing styles like position, min-height etc. */
    position: relative;
    min-height: 12rem;
    /* ... */
}
.note-card,
.project-card {
    opacity: 0;
    transform: translateY(15px); /* Start slightly down */
    transition-property: opacity, transform;
    transition-duration: 0.5s; /* <<< INCREASE duration (e.g., 500ms) */
    transition-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1); /* Example ease-out-expo like */
}

/* State when the 'card-visible' class is added by JS */
.note-card.card-visible,
.project-card.card-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Note Info Modal --- */
#noteInfoModalOverlay {
    position: fixed;
    inset: 0;
    z-index: 100; /* Ensure it's above everything */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem; /* p-4 */
    background-color: rgba(17, 24, 39, 0.6); /* gray-900 with opacity */
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);

    /* Animation */
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.3s ease-out,
        visibility 0.3s ease-out;
}
#noteInfoModalOverlay.visible {
    opacity: 1;
    visibility: visible;
}

#noteInfoModalOverlay > .modal-content {
    position: relative;
    width: 100%;
    max-width: 28rem; /* max-w-md */
    max-height: 85vh;
    background-color: #ffffff;
    border-radius: 0.75rem; /* rounded-xl */
    box-shadow:
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 8px 10px -6px rgba(0, 0, 0, 0.1); /* shadow-2xl */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Clip content */

    /* Animation */
    transform: scale(0.95);
    transition: transform 0.3s ease-out;
}
.dark #noteInfoModalOverlay > .modal-content {
    background-color: #1f2937; /* gray-800 */
    border: 1px solid #374151; /* gray-700 */
}
#noteInfoModalOverlay.visible > .modal-content {
    transform: scale(1);
}

/* Custom scrollbar for info modal content */
#noteInfoModalContent.custom-scrollbar::-webkit-scrollbar {
    width: 5px;
}
#noteInfoModalContent.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
#noteInfoModalContent.custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: rgba(139, 92, 246, 0.4);
    border-radius: 3px;
}
.dark #noteInfoModalContent.custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: rgba(120, 113, 108, 0.5);
}

/* --- End Note Info Modal --- */

/* --- Note Share Modal --- */
#noteShareModalOverlay {
    position: fixed;
    inset: 0;
    z-index: 100; /* Above everything */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem; /* p-4 */
    background-color: rgba(17, 24, 39, 0.6); /* gray-900 with opacity */
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);

    /* Animation */
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.3s ease-out,
        visibility 0.3s ease-out;
}
#noteShareModalOverlay.visible {
    opacity: 1;
    visibility: visible;
}

#noteShareModalOverlay > .modal-content {
    position: relative;
    width: 100%;
    max-width: 24rem; /* max-w-sm */
    background-color: #ffffff;
    border-radius: 0.75rem; /* rounded-xl */
    box-shadow:
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 8px 10px -6px rgba(0, 0, 0, 0.1); /* shadow-2xl */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Clip content */

    /* Animation */
    transform: scale(0.95);
    transition: transform 0.3s ease-out;
}
.dark #noteShareModalOverlay > .modal-content {
    background-color: #1f2937; /* gray-800 */
    border: 1px solid #374151; /* gray-700 */
}
#noteShareModalOverlay.visible > .modal-content {
    transform: scale(1);
}

/* --- End Note Share Modal --- */

/* mindmap-custom.css OR notelist.css */

/* --- Note Content Modal --- */
#noteContentModalOverlay {
    position: fixed;
    inset: 0;
    z-index: 100; /* Ensure it's above everything */
    display: flex;
    align-items: center; /* Center vertically */
    justify-content: center; /* Center horizontally */
    padding: 1rem; /* p-4 */
    background-color: rgba(17, 24, 39, 0.65); /* gray-900 with opacity */
    backdrop-filter: blur(5px); /* Adjust blur amount as needed */
    -webkit-backdrop-filter: blur(5px);

    /* Animation */
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.3s ease-out,
        visibility 0.3s ease-out;
}
#noteContentModalOverlay.visible {
    opacity: 1;
    visibility: visible;
}

#noteContentModalOverlay > .modal-content {
    position: relative;
    width: 100%;
    max-width: 42rem; /* max-w-2xl - Allow more width for content */
    max-height: 85vh; /* Limit height */
    /* background-color: rgba(255, 255, 255, 0.52);  White with slight transparency */
    border-radius: 0.75rem; /* rounded-xl */
    box-shadow:
        0 20px 25px -5px rgba(255, 255, 255, 0.1),
        0 8px 10px -6px rgba(255, 255, 255, 0.1); /* shadow-2xl */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Important for rounded corners + scrolling child */
    backdrop-filter: blur(5px); /* Adjust blur amount as needed */

    /* Animation */
    transform: scale(0.95);
    transition: transform 0.3s ease-out;
}
.dark #noteContentModalOverlay > .modal-content {
    /* background-color: rgba(31, 41, 55, 0.92); /* gray-800 with slight transparency */
    border: 1px solid #374151; /* gray-700 */
}
#noteContentModalOverlay.visible > .modal-content {
    transform: scale(1);
}

/* Style the content area specifically */
#noteContentModalBody {
    flex-grow: 1; /* Allow body to fill available space */
    overflow-y: auto; /* Make ONLY the body scrollable */
    padding: 1.25rem 1.5rem; /* p-5 sm:p-6 */
}

/* Apply prose styles for rendered Markdown/HTML if needed */
#noteContentModalBody .prose {
    max-width: none; /* Allow prose to fill container */
}
/* Add specific prose dark styles if not using Tailwind plugin */
.dark #noteContentModalBody .prose-invert {
    color: #d1d5db; /* gray-300 */
}
.dark #noteContentModalBody .prose-invert a {
    color: #60a5fa;
}
.dark #noteContentModalBody .prose-invert strong {
    color: #c084fc;
}
/* Add more dark prose styles as needed */

/* --- End Note Content Modal --- */

/* Ensure custom scrollbar applies */
#noteContentModalBody.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}
#noteContentModalBody.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
#noteContentModalBody.custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: rgba(139, 92, 246, 0.4);
    border-radius: 3px;
}
.dark #noteContentModalBody.custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: rgba(120, 113, 108, 0.5);
}

/* mindmap-custom.css OR notelist.css */

/* --- Ask AI Feature (Keep its high z-index) --- */
/* ... existing AskAI styles with z-index: 9998 / 9999 ... */

/* --- Galaxy View (Highest Z-Index for Testing) --- */


/* Add styles for the calendar view */

#calendarViewOverlay {
    /* Base styles defined in JS */
}

.calendar-grid {
    /* grid grid-cols-7 gap-1 defined in JS */
}

.calendar-day-cell {
    /* Base styles defined in JS */
    min-height: 3.5rem; /* Ensure a minimum height */
}

.calendar-day-cell.empty {
    background-color: transparent !important;
    border-color: transparent !important;
    cursor: default;
}

.day-number {
    /* Base styles defined in JS */
}

.note-indicator {
    /* Base styles defined in JS */
}

#dayNotesList {
    /* Base styles defined in JS */
}

.day-note-item {
    /* Base styles defined in JS */
}

/* Custom scrollbar for notes list */
#dayNotesList.custom-scrollbar::-webkit-scrollbar { width: 5px; }
#dayNotesList.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
#dayNotesList.custom-scrollbar::-webkit-scrollbar-thumb { background-color: rgba(139, 92, 246, 0.5); border-radius: 3px; }
.dark #dayNotesList.custom-scrollbar::-webkit-scrollbar-thumb { background-color: rgba(120, 113, 108, 0.6); }





#askAiBottomBackdrop {
    position: fixed;
    inset: 0;
    height: 100vh;
    /* Explicit High Z-Index */
    z-index: 9998; /* << SET HERE */

    background-color: rgba(243, 244, 246, 0.12); /* Light mode BG */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    /* Gradient Mask */
    mask-image: linear-gradient(to bottom, transparent 30%, black 65%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 30%, black 65%);

    /* Visibility & Transition */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-out;
    pointer-events: auto;
}
.dark #askAiBottomBackdrop {
    background-color: rgba(17, 24, 39, 0.75); /* Dark mode BG */
}
#askAiBottomBackdrop.visible {
    opacity: 1;
    visibility: visible;
}

/* Centering Container for the Panel */
#askAiOverlayPanel {
    position: fixed;
    inset: 0;
    /* Explicit High Z-Index */
    z-index: 9999; /* << SET HERE (Higher than backdrop) */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem; /* p-4 */
    pointer-events: none; /* Pass clicks through unless hitting inner panel */
    /* Visibility & Transition */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-out;
}
#askAiOverlayPanel.visible {
    opacity: 1;
    visibility: visible;
}

/* Inner Content Box (scale transition) */
#askAiOverlayPanel > .askai-content-box {
    transform: scale(0.95);
    transition: transform 0.3s ease-out;

    backdrop-filter: blur(6px);
    /* pointer-events: auto; */ /* This should be set via Tailwind in JS */
}
#askAiOverlayPanel.visible > .askai-content-box {
    transform: scale(1);
    max-height: -webkit-fill-available;
}

.ql-container.ql-snow {
    border: none;
}
.ql-editor {
    padding: 0;
}
.ql-container {
    box-sizing: border-box;
    font-family: Helvetica, Arial, sans-serif;
    height: 100%;
    margin: 0;
    position: relative;
}
#readOnlyQuillContainer {
    border: hidden;
    font-size: inherit;
}


.grid {
    /* Remove the previously added pb-20 */
    padding-bottom: 4rem; /* Add some default bottom padding back */
}
/* If notes grid is directly inside .listCont */
/* .listCont { padding-bottom: calc(4rem + env(safe-area-inset-bottom)); } */


/* Style for the bottom nav bar container */
#notelist-bottom-nav {
    /* Tailwind classes handle most styling (bg, blur, border) */
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05); /* Subtle top shadow */
}
.dark #notelist-bottom-nav {
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}

/* Optional: Style for the buttons if more customization is needed */
.nl-bottom-nav-button svg {
    /* Ensure consistent icon size */
}





.custom-toggle-checkbox {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db; /* Tailwind gray-300 */
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
    outline: none;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
    vertical-align: middle;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 60%; /* Adjust size of checkmark SVG */
}

.dark .custom-toggle-checkbox {
    border-color: #4b5563; /* Tailwind gray-600 */
    background-color: #374151; /* Tailwind gray-700 */
}

/* Checked state */
.custom-toggle-checkbox:checked {
    background-color: #8b5cf6; /* Tailwind purple-500 */
    border-color: #7c3aed;    /* Tailwind purple-600 */
    /* SVG Checkmark (URL-encoded white checkmark) */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='white'%3E%3Cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3E%3C/svg%3E");
}

.dark .custom-toggle-checkbox:checked {
    background-color: #a78bfa; /* Tailwind purple-400 */
    border-color: #8b5cf6;    /* Tailwind purple-500 */
    /* SVG Checkmark for dark mode (still white check on purple bg) */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='white'%3E%3Cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3E%3C/svg%3E");
}





/* Dark mode styles for common Tailwind elements */
.dark .bg-white {
    background-color: #1a202c;
}

.dark .text-gray-900 {
    color: #f7fafc;
}

.dark .border-gray-200 {
    border-color: #2d3748;
}

.dark .bg-purple-100 {
    background-color: rgba(45, 55, 72, 0.58);
}

.dark .bg-blue-100 {
    background-color: rgba(44, 37, 214, 0.22);
}

.dark .bg-yellow-100 {
    background-color: rgba(70, 72, 45, 0.37);
}

.dark .bg-red-100 {
    background-color: rgba(72, 52, 45, 0.37);
}

.dark .bg-green-100 {
    background-color: rgba(51, 72, 45, 0.37);
}

.dark .bg-indigo-100 {
    background-color: rgba(20, 15, 75, 0.37);
}

.dark .bg-black {
    background-color: rgba(15, 19, 26, 0.22);
}

.dark .bg-purple-200 {
    background-color: rgba(61, 63, 66, 0.26);
}

.dark .bg-purple-50 {
    background-color: rgba(45, 55, 72, 0.21);
}

.dark .text-gray-700 {
    color: #e0e0e0;
}
