/* n1.css - Notebook Dashboard Styles */

/* Main Notebook App Container - Works in the middle space only */
.notebook-app {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex: 1;
    z-index: 1;
    overflow: hidden;
}

html.dark .notebook-app {
    background-color: #191022;
}

html.dark .main-content-dashboard {
    background: transparent;
}

html.dark .header-dashboard {
    background: transparent;
}

html.dark .dashboard-content {
    background: transparent;
}

/* CSS Variables */
:root {
    --primary: #311a49;
    --surface-light: #ffffff;
    --sidebar-light: #ffffff;
    --sidebar-dark: #1a1a1a;
    --background-light: #f9fafb;
    --background-dark: #0f0f0f;
    --surface-dark: #1e1e1e;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #132b5e;
}

/* Light Mode Overrides */
body.light-mode {
    --primary: #7f13ec;
    --sidebar-light: #ffffff;
    --background-light: #f5f5f0;
    --surface-light: #ffffff;
    --gray-900: white;
    --gray-800: #1f2937;
    --gray-700: #374151;
    --gray-600: #4b5563;
    background-color: var(--background-light);
}

body.light-mode .notebook-app {
    background-color: transparent; /* Make transparent to show body dots */
}

body.light-mode .sidebar {
    background-color: transparent;
    border-right-color: rgba(48, 92, 185, 0.3);
}

body.light-mode .logo-text {
    color: #ffffff;
}

body.light-mode .profile-name {
    color: #ffffff;
}

body.light-mode .nav-link {
    color: var(--gray-700);
}

body.light-mode .nav-link:hover {
    background-color: var(--gray-100);
}

body.light-mode .nav-link.active {
    background-color: rgba(127, 19, 236, 0.1);
    color: var(--primary);
}

body.light-mode .welcome-title {
    color: var(white);
}

body.light-mode .welcome-subtitle {
    color: var(white);
}

body.light-mode .section-title {
    color: var(--gray-900);
}

body.light-mode .widget-title {
    color: var(--gray-900);
}

body.light-mode .notebook-title {
    color: var(--gray-900);
}

body.light-mode .note-title {
    color: #1f2937;
}

body.light-mode .action-label {
    color: var(--gray-700);
}

body.light-mode .favorite-item {
    color: var(--gray-700);
}

body.light-mode .search-input {
    color: var(--gray-900);
}

body.light-mode .scratchpad-textarea {
    color: black;
}

body.light-mode .icon-btn {
    color: var(--gray-600);
}

body.light-mode .icon-btn:hover {
    background-color: var(--gray-100);
}

body.light-mode .main-content-dashboard {
    background: transparent;
}

body.light-mode .header-dashboard {
    background: transparent;
}

body.light-mode .dashboard-content {
    background: transparent;
}

body.light-mode .logo-area {
    border-bottom-color: var(--gray-200);
}


body.light-mode .action-card {
    background-color: var(--surface-light);
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

body.light-mode .recent-notes-list {
    background-color: transparent;
    border-color: transparent;
}

body.light-mode .note-item {
    background-color: var(--surface-light);
    border: 1px solid var(--gray-200);
    margin-bottom: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

body.light-mode .note-item:hover {
    background-color: var(--gray-50);
}

body.light-mode .favorites-widget {
    background-color: var(--surface-light);
    border-color: var(--gray-200);
}

body.light-mode .favorite-item:hover {
    background-color: var(--gray-50);
}

body.light-mode .scratchpad {
    background-color: #fef3c7;
    border-color: #fbbf24;
}

body.light-mode .scratchpad-title {
    color: #92400e;
}

body.light-mode .scratchpad-menu {
    color: rgba(146, 64, 14, 0.5);
}

body.light-mode .scratchpad-menu:hover {
    color: #92400e;
}

body.light-mode .scratchpad-footer {
    color: rgba(146, 64, 14, 0.6);
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 12px;
}

html.dark .mobile-menu-btn {
    color: #d1d5db;
}

.mobile-menu-btn:hover {
    background-color: var(--gray-200);
}

html.dark .mobile-menu-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

@media (max-width: 640px) {
    .mobile-menu-btn {
        display: flex;
    }
}

/* Sidebar Overlay (mobile only) */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Sidebar Toggle Button */
.sidebar-toggle-btn {
    position: fixed;
    left: 272px; /* 256px sidebar width + 16px margin */
    top: 120px;
    width: 40px;
    height: 40px;
    background: var(--header-footer-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 51;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Position toggle button when sidebar is hidden */
.sidebar.hidden + .sidebar-toggle-btn {
    left: 16px;
}

.sidebar-toggle-btn:hover {
    background: var(--card-bg);
    transform: scale(1.05);
}

.sidebar-toggle-btn .material-symbols-outlined {
    font-size: 24px;
    color: var(--text-primary);
    transition: transform 0.3s ease;
}

.sidebar.hidden + .sidebar-toggle-btn .material-symbols-outlined {
    transform: rotate(180deg);
}

/* Sidebar Styles - NOW RESPONSIVE */
.sidebar {
    width: 256px;
    height: 100%;
    background-color:transparent;
    border-right: 1px solid rgb(255, 255, 255);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: all 0.3s ease;
    overflow-y: auto;
    z-index: 50;
    position: relative;
}

/* Dark mode sidebar */
html.dark .sidebar {
    background-color: transparent; /* More transparent dark */
    border-right-color: rgb(255, 255, 255);
}

/* Hidden state for sidebar */
.sidebar.hidden {
    margin-left: -256px;
    width: 256px;
}

/* Adjust main content when sidebar is hidden */
.sidebar.hidden ~ .main-content-dashboard {
    margin-left: 0;
}

/* RESPONSIVE SIDEBAR BREAKPOINTS */
@media (max-width: 1280px) {
    .sidebar {
        width: 220px;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }

    .nav-link {
        gap: 10px;
        padding: 10px 12px;
    }

    .nav-link .material-symbols-outlined {
        font-size: 22px;
        width: 22px;
        height: 22px;
    }

    .logo-text {
        font-size: 18px;
    }

    .profile-name {
        font-size: 15px;
    }

    .profile-plan {
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }

    .logo-text,
    .profile-info,
    .nav-link span:not(.material-symbols-outlined),
    .btn-primary span:not(.material-symbols-outlined) {
        display: block;
    }

    .sidebar-search-actions {
        padding: 10px 12px;
    }

    .search-wrapper {
        width: 100%;
        justify-content: flex-start;
    }

    .search-input {
        display: block;
    }

    .user-profile {
        padding: 18px 12px;
    }

    .profile-header {
        justify-content: flex-start;
    }

    .profile-avatar {
        width: 42px;
        height: 42px;
        font-size: 16px;
    }

    .nav-links {
        align-items: stretch;
        padding: 0 12px;
    }

    .nav-link {
        justify-content: flex-start;
        padding: 10px 12px;
    }

    .sidebar-bottom {
        padding: 12px;
    }
}

/* Mobile sidebar - slides in from left */
@media (max-width: 640px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        z-index: 1002;
        box-shadow: 6px 0 28px rgba(0, 0, 0, 0.28);
        pointer-events: auto;
    }
    
    .sidebar.mobile-open {
        left: 0;
    }

    .sidebar,
    .sidebar * {
        pointer-events: auto;
    }
    
    /* Show full search on mobile when open */
    .sidebar.mobile-open .search-wrapper {
        width: 100%;
    }
    
    .sidebar.mobile-open .search-input {
        display: block;
    }
    
    /* Show all text on mobile when open */
    .sidebar.mobile-open .logo-text,
    .sidebar.mobile-open .profile-info,
    .sidebar.mobile-open .nav-link span:not(.material-symbols-outlined),
    .sidebar.mobile-open .btn-primary span:not(.material-symbols-outlined) {
        display: block;
    }
    
    .sidebar.mobile-open .nav-link {
        justify-content: flex-start;
        padding: 10px 12px;
    }
    
    .sidebar.mobile-open .profile-header {
        justify-content: flex-start;
    }
    
    .sidebar.mobile-open .user-profile {
        padding: 24px 16px;
    }
    
    .sidebar.mobile-open .sidebar-bottom {
        padding: 16px;
    }
    
    .main-content-dashboard {
        margin-left: 0;
    }
}

html.dark .sidebar {
    background-color: var(--sidebar-dark);
    border-right-color: rgba(255, 255, 255, 0.1);
}

.logo-area {
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--gray-100);
}

/* Sidebar Search and Actions Section */
.sidebar-search-actions {
    padding: 16px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

html.dark .sidebar-search-actions {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.search-container-sidebar {
    width: 100%;
}

@media (max-width: 768px) {
    .logo-area {
        justify-content: center;
        padding: 0 8px;
    }
}

html.dark .logo-area {
    border-bottom-color: rgba(255, 255, 0.05);
}

.logo-notebook {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
}

.logo-notebook .material-symbols-outlined {
    font-size: 30px;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--gray-900);
}

body:not(.light-mode) .logo-text {
    color: #ffffff;
}

.user-profile {
    padding: 24px 0; /* Remove left/right padding to control alignment better */
}

.profile-header {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 24px;
    padding: 0 16px; /* Add padding here for consistent alignment */
}

.profile-avatar {
    width: 48px;
    height: 48px;
    border-radius: 9999px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-size: cover;
    background-position: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 18px;
}

.profile-info {
    display: flex;
    flex-direction: column;
}

.profile-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--gray-900);
}

body:not(.light-mode) .profile-name {
    color: #ffffff;
}

.profile-plan {
    font-size: 14px;
    color: var(--primary);
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 16px; /* Added padding for consistent left alignment */
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Force left alignment */
    gap: 12px;
    padding: 10px 12px;
    margin: 0; /* Remove any default margins */
    border-radius: 8px;
    color: var(--gray-600);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
    text-align: left; /* Ensure text aligns left */
    width: 100%; /* Take full width of container */
    box-sizing: border-box; /* Include padding in width calculation */
}

.nav-link:hover {
    background-color: var(--gray-100);
}

html.dark .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    background-color: rgba(127, 19, 236, 0.1);
    color: var(--primary);
    font-weight: 700;
}

html.dark .nav-link.active {
    background-color: rgba(127, 19, 236, 0.2);
}

.nav-link .material-symbols-outlined {
    font-size: 24px;
    width: 24px; /* Fixed width for icons */
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* Prevent icon from shrinking */
}

.sidebar-bottom {
    margin-top: auto;
    padding: 16px; /* Consistent padding all around */
    border-top: 1px solid var(--gray-200);
}

html.dark .sidebar-bottom {
    border-top-color: var(--gray-800);
}

.sidebar-bottom .nav-link {
    margin-bottom: 16px;
    padding-left: 12px; /* Align with other nav items */
    padding-right: 12px;
}

.btn-primary {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 10px 25px rgba(127, 19, 236, 0.3);
}

.btn-primary:hover {
    background-color: #6e11d0;
}

.btn-primary .material-symbols-outlined {
    font-size: 18px;
}

/* Main Content */
.main-content-dashboard {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    position: relative;
    width: 100%;
    background: transparent;
    padding-top: 0;
    margin-top: 0;
}

.header-dashboard {
    position: sticky;
    top: 72px;
    left: 0;
    right: 0;
    height: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0;
    margin: 0;
    border-bottom: 0px solid transparent;
    flex-shrink: 0;
    z-index: 10;
    transition: all 0.3s ease;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
    overflow: visible;
}

/* Hide search container in header */
.header-dashboard .search-container {
    display: none;
}

/* Hide mobile menu button */
.header-dashboard .mobile-menu-btn {
    display: none;
}

@media (max-width: 768px) {
    .header-dashboard {
        padding: 0;
        height: 0;
        min-height: 0;
    }
}

.search-container {
    flex: 1;
    max-width: 576px;
    display: none;
    background: transparent !important;
}

@media (max-width: 768px) {
    .search-container {
        max-width: 100%;
        display: none;
        background: transparent !important;
    }
}

.search-wrapper {
    display: flex;
    align-items: center;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    height: 40px;
    overflow: hidden;
    transition: all 0.2s;
    width: 100%;
}

body.light-mode .search-wrapper {
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

html.dark .search-wrapper {
    background-color: rgba(30, 30, 30, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.search-wrapper:focus-within {
    border-color: rgba(117, 72, 162, 0.5);
    box-shadow: 0 0 0 4px rgba(127, 19, 236, 0.1);
}

.search-icon {
    color: var(--gray-400);
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 12px;
}

html.dark .search-icon {
    color: var(--gray-500);
}

.search-input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    font-size: 14px;
    color: white;
    padding-left: 8px;
    height: 100%;
}

body.light-mode .search-input {
    color: #1f2937;
}

html.dark .search-input {
    color: white;
}

.search-input::placeholder {
    color: rgba(255,255,255,0.35);
}

body.light-mode .search-input::placeholder {
    color: rgba(0,0,0,0.35);
}

.search-shortcut {
    padding-right: 8px;
    display: flex;
    align-items: center;
}

.search-shortcut span {
    font-size: 12px;
    color: var(--gray-400);
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    padding: 2px 6px;
}

@media (max-width: 768px) {
    .search-shortcut {
        display: none;
    }
}

html.dark .search-shortcut span {
    border-color: var(--gray-700);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-left: 0;
    padding: 10px;
    background: transparent !important;
    position: fixed;
    top: 80px;
    right: 32px;
    z-index: 100;
}

@media (max-width: 768px) {
    .header-actions {
        gap: 8px;
        padding-left: 16px;
    }
}

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

html.dark .icon-btn {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #d1d5db;
}

.icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

html.dark .icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 9999px;
    border: 2px solid var(--background-light);
}

html.dark .notification-dot {
    border-color: var(--background-dark);
}

.dashboard-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 32px;
    padding-top: 0;
    scroll-behavior: smooth;
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
    background: transparent;
    margin-top: 0;
}

@media (max-width: 768px) {
    .dashboard-content {
        padding: 0 16px;
        padding-top: 16px;
    }
}

.content-wrapper {
    max-width: 1152px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding-bottom: 32px;
    padding-top: 20px;
    width: 100%;
    margin-top: 0;
}

/* Remove gap before first visible child */
.content-wrapper > *:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.welcome-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 0;
    padding-top: 0;
}

.welcome-title {
    font-size: 36px;
    font-weight: 900;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}

@media (max-width: 768px) {
    .welcome-title {
        font-size: 28px;
    }
}

html.dark .welcome-title,
body:not(.light-mode) .welcome-title {
    color: #ffffff;
}

.welcome-subtitle {
    font-size: 18px;
    color: var(--gray-500);
}

@media (max-width: 768px) {
    .welcome-subtitle {
        font-size: 16px;
    }
}

html.dark .welcome-subtitle,
body:not(.light-mode) .welcome-subtitle {
    color: #9ca3af;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    border-radius: 16px;
    background-color: var(--surface-light);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: none; /* Remove border */
    width: 112px;
    transition: all 0.2s;
}

html.dark .action-card {
    background-color: var(--surface-dark);
    border-color: rgba(255, 255, 255, 0.05);
}

.action-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

.action-icon {
    border-radius: 9999px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.action-icon.primary {
    background-color: rgba(127, 19, 236, 0.1);
    color: var(--primary);
}

.action-card:hover .action-icon.primary {
    background-color: var(--primary);
    color: white;
}

.action-icon.blue {
    background-color: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

html.dark .action-icon.blue {
    background-color: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.action-card:hover .action-icon.blue {
    background-color: #2563eb;
    color: white;
}

.action-icon.orange {
    background-color: rgba(249, 115, 22, 0.1);
    color: #ea580c;
}

html.dark .action-icon.orange {
    background-color: rgba(249, 115, 22, 0.2);
    color: #fb923c;
}

.action-card:hover .action-icon.orange {
    background-color: #ea580c;
    color: white;
}

.action-icon.green {
    background-color: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

html.dark .action-icon.green {
    background-color: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.action-card:hover .action-icon.green {
    background-color: #16a34a;
    color: white;
}

.action-icon .material-symbols-outlined {
    font-size: 24px;
}

.action-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
}

html.dark .action-label {
    color: #e5e7eb;
}

.main-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    margin-top: 0;
    padding-top: 0;
}

@media (min-width: 1024px) {
    .main-grid {
        grid-template-columns: 2fr 1fr;
    }
}

.left-column {
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin-top: 0;
    padding-top: 0;
}

.left-column > *:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    margin-top: 0;
    padding-top: 0;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
}

html.dark .section-title,
body:not(.light-mode) .section-title {
    color: #ffffff;
}

.view-all-btn {
    font-size: 14px;
    font-weight: 500;
    color: var(--primary);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
}

.view-all-btn:hover {
    color: #6e11d0;
}

.notebooks-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (min-width: 768px) {
    .notebooks-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 640px) {
    .notebooks-grid {
        grid-template-columns: 1fr;
    }
}

.notebook-card {
    border-radius: 12px;
    padding: 12px;
    border: 1px solid var(--gray-100);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    background-color: #ffffff; /* Solid white background */
    transition: all 0.2s;
}

html.dark .notebook-card {
    background-color: var(--surface-dark);
    border-color: rgba(255, 255, 255, 0.05);
}

body.light-mode .notebook-card {
    background-color: #ffffff; /* Ensure solid white in light mode */
    border-color: var(--gray-200);
}

.notebook-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.notebook-cover {
    aspect-ratio: 4/3;
    width: 100%;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
}

.notebook-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.notebook-card:hover .notebook-cover::after {
    background-color: rgba(0, 0, 0, 0);
}

.notebook-title {
    font-weight: 700;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
}

html.dark .notebook-title,
body:not(.light-mode) .notebook-title {
    color: #ffffff;
}

.notebook-time {
    font-size: 12px;
    color: var(--gray-500);
}

html.dark .notebook-time {
    color: var(--gray-400);
}

.recent-notes-list {
    border-radius: 12px;
    border: 1px solid var(--gray-100);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    background-color: transparent; /* Make transparent */
}

html.dark .recent-notes-list {
    background-color: transparent;
    border-color: rgba(255, 255, 255, 0.05);
}

.note-item {
    display: flex;
    align-items: center;
    padding: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: none; /* Remove border */
    background-color: var(--surface-light); /* Add background to each item */
    margin-bottom: 12px; /* Add spacing between items */
    border-radius: 12px; /* Round corners */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

html.dark .note-item {
    background-color: #ffffff;
    border-bottom: none;
}

.note-item:last-child {
    border-bottom: none;
}

.note-item:hover {
    background-color: var(--background-light);
}

html.dark .note-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.note-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    flex-shrink: 0;
}

.note-icon.primary {
    background-color: rgba(127, 19, 236, 0.1);
    color: var(--primary);
}

.note-icon.orange {
    background-color: rgba(249, 115, 22, 0.1);
    color: #ea580c;
}

html.dark .note-icon.orange {
    background-color: rgba(249, 115, 22, 0.2);
    color: #fb923c;
}

.note-icon.green {
    background-color: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

html.dark .note-icon.green {
    background-color: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.note-icon.purple {
    background-color: rgba(168, 85, 247, 0.1);
    color: #9333ea;
}

html.dark .note-icon.purple {
    background-color: rgba(168, 85, 247, 0.2);
    color: #c084fc;
}

.note-info {
    flex: 1;
    min-width: 0;
}

.note-title {
    font-weight: 700;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
    margin-bottom: 2px;
}

html.dark .note-title,
body:not(.light-mode) .note-title {
    color: #1f2937;
}

.note-meta {
    font-size: 14px;
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

html.dark .note-meta,
body:not(.light-mode) .note-meta {
    color: #6b7280;
}

.note-time {
    text-align: right;
    padding-left: 16px;
}

.note-time p {
    font-size: 12px;
    color: var(--gray-400);
}

html.dark .note-time p,
body:not(.light-mode) .note-time p {
    color: #6b7280;
}

.right-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.scratchpad {
    border-radius: 12px;
    border: 1px solid white;
    padding: 20px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
    position: relative;
    height: 320px;
    display: flex;
    flex-direction: column;
}

html.dark .scratchpad {
    background-color: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.scratchpad:hover {
    transform: rotate(-1deg);
}

.scratchpad-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.scratchpad-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #854d0e;
}

html.dark .scratchpad-title {
    color: #fbbf24;
}

.scratchpad-title .material-symbols-outlined {
    font-size: 18px;
}

.scratchpad-title h3 {
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.05em;
}

.scratchpad-menu {
    color: rgba(133, 77, 14, 0.5);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
}

html.dark .scratchpad-menu {
    color: rgba(251, 191, 36, 0.5);
}

.scratchpad-menu:hover {
    color: #854d0e;
}

html.dark .scratchpad-menu:hover {
    color: #fbbf24;
}

.scratchpad-textarea {
    width: 100%;
    flex: 1;
    background: transparent;
    border: none;
    resize: none;
    outline: none;
    padding: 0;
    color: #ffffff;
    font-size: 16px;
    line-height: 1.6;
    font-family: 'Manrope', sans-serif;
}

html.dark .scratchpad-textarea {
    color: #e5e7eb;
}

.scratchpad-textarea::placeholder {
    color: rgba(207, 209, 211, 0.5);
}

.scratchpad-footer {
    margin-top: 8px;
    font-size: 12px;
    color: rgba(133, 77, 14, 0.6);
    display: flex;
    align-items: center;
    gap: 6px;
}

html.dark .scratchpad-footer {
    color: rgba(251, 191, 36, 0.6);
}

.favorites-widget {
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--gray-100);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

html.dark .favorites-widget {
    background-color: var(--surface-dark);
    border-color: rgba(255, 255, 255, 0.05);
}

.widget-title {
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
}

html.dark .widget-title,
body:not(.light-mode) .widget-title {
    color: #ffffff;
}

.widget-title .material-symbols-outlined {
    color: var(--primary);
}

.favorites-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.favorite-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 8px;
    transition: background-color 0.2s;
    text-decoration: none;
    color: var(--gray-700);
    font-size: 14px;
    font-weight: 500;
}

html.dark .favorite-item {
    color: #0a264f;
}

.favorite-item:hover {
    background-color: var(--gray-50);
}

html.dark .favorite-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.favorite-item .material-symbols-outlined {
    color: var(--gray-400);
    font-size: 20px;
}

/* ── Inner sidebar toggle button ── */
.sidebar-inner-toggle {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.5);
    transition: all 0.2s;
    flex-shrink: 0;
    margin-left: auto;
}

.sidebar-inner-toggle:hover {
    background: rgba(255,255,255,0.12);
    color: white;
}

.sidebar-inner-toggle .material-symbols-outlined {
    font-size: 18px;
    transition: transform 0.3s ease;
}

body.light-mode .sidebar-inner-toggle {
    border-color: rgba(0,0,0,0.12);
    background: rgba(0,0,0,0.04);
    color: rgba(0,0,0,0.45);
}

body.light-mode .sidebar-inner-toggle:hover {
    background: rgba(0,0,0,0.08);
    color: #111;
}

/* ── Collapsed sidebar state ── */
.sidebar.hidden {
    margin-left: 0 !important;
    width: 64px !important;
    min-width: 64px !important;
    overflow: visible !important;
}

.sidebar.hidden .logo-text,
.sidebar.hidden .search-wrapper,
.sidebar.hidden .profile-info,
.sidebar.hidden .nav-link span:not(.material-symbols-outlined),
.sidebar.hidden .btn-primary span:not(.material-symbols-outlined),
.sidebar.hidden .sidebar-bottom .btn-primary {
    display: none !important;
}

.sidebar.hidden .sidebar-inner-toggle {
    margin-left: 0;
}

.sidebar.hidden .sidebar-inner-toggle .material-symbols-outlined {
    transform: rotate(180deg);
}

.sidebar.hidden .logo-area {
    justify-content: center;
    padding: 0 12px;
}

.sidebar.hidden .logo-notebook {
    justify-content: center;
}

.sidebar.hidden .sidebar-search-actions {
    padding: 8px;
}

.sidebar.hidden .user-profile {
    padding: 12px 0;
}

.sidebar.hidden .profile-header {
    justify-content: center;
    padding: 0 8px;
    margin-bottom: 8px;
}

.sidebar.hidden .nav-links {
    align-items: center;
    padding: 0 8px;
}

.sidebar.hidden .nav-link {
    justify-content: center;
    padding: 10px;
    width: 44px;
    border-radius: 10px;
    position: relative;
}

/* Active dot indicator */
.sidebar.hidden .nav-link.active::after {
    content: '';
    position: absolute;
    right: 4px;
    top: 4px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #7f13ec;
    box-shadow: 0 0 6px rgba(127,19,236,0.8);
}

/* Tooltip on hover */
.sidebar.hidden .nav-link::before {
    content: attr(data-label);
    position: absolute;
    left: 56px;
    top: 50%;
    transform: translateY(-50%);
    background: #1a1a2e;
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 7px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 200;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.sidebar.hidden .nav-link:hover::before {
    opacity: 1;
}

body.light-mode .sidebar.hidden .nav-link::before {
    background: #fff;
    color: #111;
    border-color: rgba(0,0,0,0.1);
}

.sidebar.hidden .sidebar-bottom {
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sidebar.hidden .sidebar-bottom .nav-link {
    margin-bottom: 8px;
}

/* Copyright text */
.sidebar-copyright {
    font-size: 11px;
    color: rgba(255,255,255,0.25);
    text-align: center;
    padding: 8px 4px 0;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.light-mode .sidebar-copyright {
    color: rgba(0,0,0,0.25);
}

.sidebar.hidden .sidebar-copyright {
    display: none;
}
