/* Notes Interface Styles */
.notes-container {
    display: none; /* Hidden by default */
 
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 20; /* Above homepage (z-index 10) */
    padding: 2rem;
    gap: 1.5rem;
    color: var(--text-primary);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Sidebar (File Explorer) */
.notes-sidebar {
    width: 300px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 1.2rem;
    font-weight: 500;
}

.sidebar-actions {
    display: flex;
    gap: 0.5rem;
}

.sidebar-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 6px;
    transition: background 0.2s;
}

.sidebar-btn:hover {
    background: var(--glass-bg-hover);
}

.file-tree {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

/* Tree Items */
.tree-item {
    margin-bottom: 2px;
}

.tree-item-header {
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between; /* Changed to space-between */
    gap: 0.5rem;
    transition: background 0.2s;
    user-select: none;
}

.item-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-actions {
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s;
}

.tree-item-header:hover .item-actions {
    opacity: 1;
}

.rename-item-btn, .delete-item-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.rename-item-btn {
    color: var(--text-primary);
    opacity: 0.7;
}

.delete-item-btn {
    color: rgba(255, 100, 100, 0.7);
}

.rename-item-btn:hover, .delete-item-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    opacity: 1;
}

.item-name[contenteditable="true"] {
    background: rgba(255, 255, 255, 0.1);
    padding: 0 4px;
    border-radius: 4px;
    outline: 1px solid var(--accent-color);
    min-width: 20px;
}

/* Toolbar Header Rename */
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rename-note-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    opacity: 0.6;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.2s;
}

.rename-note-btn:hover {
    background: var(--glass-bg-hover);
    opacity: 1;
}

.current-note-name[contenteditable="true"] {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    outline: 1px solid var(--accent-color);
}


.delete-item-btn:hover {
    background: rgba(255, 100, 100, 0.2);
    color: rgba(255, 100, 100, 1);
}

.tree-item-header:hover .delete-item-btn {
    opacity: 1;
}

.tree-item-header:hover {
    background: var(--glass-bg-hover);
}

.tree-item.active > .tree-item-header {
    background: var(--accent-color-alpha);
    color: var(--accent-color);
}

.tree-children {
    padding-left: 1.2rem;
    display: none;
}

.tree-item.expanded > .tree-children {
    display: block;
}

.tree-item.drag-over > .tree-item-header {
    background: rgba(100, 150, 255, 0.3);
    border: 1px dashed var(--accent-color);
}

.file-tree.drag-over-root {
    background: rgba(100, 150, 255, 0.1);
    border: 1px dashed var(--accent-color);
}

/* Main Editor Area */
.notes-main {
    flex: 1;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.editor-toolbar {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toolbar-left {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.toolbar-right {
    display: flex;
    align-items: center;
}

.current-note-name {
    font-size: 0.95rem;
    color: var(--text-primary);
    opacity: 0.7;
    font-weight: 500;
    font-style: italic;
}

.format-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.format-btn:hover {
    background: var(--glass-bg-hover);
}

.format-btn.active {
    background: var(--accent-color);
    color: #000000;
}

.format-btn.active i {
    color: #000000;
}

.editor-content {
    flex: 1;
    padding: 2rem;
    padding-bottom: 100px; /* Space for logo/footer */
    overflow-y: auto;
    outline: none;
    font-size: 1.1rem;
    line-height: 1.6;
}

.editor-content:empty:before {
    content: attr(placeholder);
    color: rgba(255, 255, 255, 0.3);
}

/* Branding & Back Button */
.notes-footer {
    position: absolute;
    bottom: 1.5rem;
    right: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    pointer-events: none; /* Let clicks pass through to background if needed, but buttons need pointer-events: auto */
}

.notes-branding {
    display: flex;
    align-items: center;
    gap: 1rem;
    opacity: 0.8;
}

.notes-logo {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

.notes-name {
    font-family: 'Skyer', sans-serif;
    font-size: 1.8rem;
    letter-spacing: 2px;
    color: white;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

.close-notes-btn {
    pointer-events: auto;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.close-notes-btn:hover {
    background: var(--glass-bg-hover);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Blockquote Styling */
blockquote {
    border-left: 4px solid var(--accent-color);
    margin: 1rem 0;
    padding: 0.5rem 1rem 0.5rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    border-radius: 0 8px 8px 0;
    min-height: 1.5em; /* Ensure it has height even if empty */
    display: block; /* Ensure block display */
}

/* Horizontal Rule Styling */
hr {
    border: 0;
    height: 1px;
    background: var(--glass-border);
    margin: 1.5rem 0;
}

/* Empty State */
.empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.empty-state-bg-logo {
    position: absolute;
    width: 300px;
    height: 300px;
    opacity: 0.03;
    pointer-events: none;
    user-select: none;
}

.empty-state-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    z-index: 1;
}

.empty-state-content p {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
}

.empty-state-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.5);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.empty-state-btn:hover {
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.05);
}

/* Undo Button Style */
.sidebar-btn.undo-btn {
    color: var(--accent-color);
}

.sidebar-btn.undo-btn:hover {
    background: rgba(100, 150, 255, 0.15);
}

/* Modal Message */
.modal-message {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    display: none;
}

/* Custom Modal */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.custom-modal {
    background: rgba(20, 20, 25, 0.8);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 20px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    transform: scale(0.95);
    animation: scaleIn 0.2s ease forwards;
}

@keyframes scaleIn {
    to { transform: scale(1); }
}

.custom-modal h3 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 500;
}

.custom-modal input {
    width: 100%;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    margin-bottom: 2rem;
    outline: none;
    transition: border-color 0.2s;
}

.custom-modal input:focus {
    border-color: var(--accent-color);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.modal-btn {
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.modal-btn.cancel {
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid transparent;
}

.modal-btn.cancel:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.modal-btn.confirm {
    background: var(--accent-color);
    color: #000;
    box-shadow: 0 4px 15px rgba(100, 150, 255, 0.3);
}

.modal-btn.confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(100, 150, 255, 0.4);
}

/* Toast Notification */
.toast-container {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: rgba(20, 20, 25, 0.9);
    backdrop-filter: blur(15px);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    animation: slideUp 0.3s ease forwards;
    pointer-events: auto;
}

.toast-action {
    background: rgba(100, 150, 255, 0.1);
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 0.4rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    font-weight: 500;
}

.toast-action:hover {
    background: var(--accent-color);
    color: #000;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.notes-branding.dimmed {
    opacity: 0.1;
    transition: opacity 0.3s ease;
}

/* Empty State */
.empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-primary);
    opacity: 0.7;
    text-align: center;
    gap: 1rem;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    font-weight: 500;
}

.create-note-btn {
    margin-top: 1rem;
    padding: 0.8rem 1.5rem;
    background: var(--accent-color);
    color: #000;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

.create-note-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

/* Custom Modal */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.custom-modal {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    padding: 2rem;
    border-radius: 16px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transform: scale(0.95);
    animation: scaleIn 0.2s ease forwards;
}

@keyframes scaleIn {
    to { transform: scale(1); }
}

.custom-modal h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.custom-modal input {
    width: 100%;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: white;
    margin-bottom: 1.5rem;
    outline: none;
}

.custom-modal input:focus {
    border-color: var(--accent-color);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.modal-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.modal-btn.cancel {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.modal-btn.cancel:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-btn.confirm {
    background: var(--accent-color);
    color: #000;
}

.modal-btn.confirm:hover {
    opacity: 0.9;
}

/* Toast Notification */
.toast-container {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: slideUp 0.3s ease forwards;
    pointer-events: auto;
}

.toast-action {
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.toast-action:hover {
    background: var(--accent-color);
    color: #000;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.notes-branding.dimmed {
    opacity: 0.1;
    transition: opacity 0.3s ease;
}
