* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #8c52ff;
    --primary-dark: #5a30ad;
    --primary-light: #b68cff;
    --text-on-primary: white;
    --text-dark: #333;
    --background-light: white;
    --background-dark: #222;
    --accent-color: #ff7eb3;
    --success-color: #42d392;
    --warning-color: #f5a623;
    --danger-color: #e74c3c;
    --border-radius: 15px;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition-speed: 0.3s;
}

/* Dark Mode Variables */
body.dark-mode {
    --primary-color: #6c3dd1;
    --primary-dark: #4e2a9d;
    --primary-light: #8e6ae0;
    --text-on-primary: white;
    --text-dark: #eee;
    --background-light: #333;
    --background-dark: #1a1a1a;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body {
    font-family: "Garamond", sans-serif;
    background-color: var(--primary-color);
    color: var(--text-dark);
    transition: background-color var(--transition-speed), color var(--transition-speed);
    min-height: 100vh;
    padding-bottom: 60px; /* Space for fixed bottom menu */
}

/* Header and Navigation */
.menu-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    margin: 10px 20px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    backdrop-filter: blur(5px);
}

.logo {
    font-size: 2.5rem;
    font-family: "Fascinate", system-ui;
    font-weight: 400;
    color: var(--text-on-primary);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.search-container {
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 400px;
    margin: 0 20px;
}

#search-bar {
    flex: 1;
    border-radius: 20px 0 0 20px;
    border: 2px solid var(--primary-dark);
    border-right: none;
    padding: 10px 15px;
    font-size: 1rem;
    height: 40px;
    background-color: var(--background-light);
    color: var(--text-dark);
}

#search-btn {
    height: 40px;
    border-radius: 0 20px 20px 0;
    border: 2px solid var(--primary-dark);
    background-color: var(--primary-dark);
    color: var(--text-on-primary);
    padding: 0 15px;
    cursor: pointer;
    transition: all var(--transition-speed);
}

#search-btn:hover {
    background-color: var(--primary-light);
}

.nav-buttons {
    display: flex;
    gap: 10px;
}

.nav-buttons button {
    padding: 10px 20px;
    font-weight: 500;
    border: none;
    border-radius: var(--border-radius);
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--text-on-primary);
    transition: all var(--transition-speed);
    cursor: pointer;
}

.nav-buttons button.active {
    background-color: var(--background-light);
    color: var(--primary-dark);
}

.nav-buttons button:hover {
    background-color: var(--primary-dark);
    color: var(--text-on-primary);
}

/* Main Content Sections */
.main {
    transition: filter var(--transition-speed);
}

.main.active {
    filter: blur(10px);
    pointer-events: none;
}

.section-content {
    display: none;
    padding: 20px;
    text-align: center;
}

.section-content.active {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.content-grid {
    width: 100%;
    max-width: 1200px;
    margin: 20px auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 10px;
    min-height: 300px;
}

.empty-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--text-on-primary);
    font-size: 1.2rem;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
}

/* Create Buttons */
.create-btn {
    position: fixed;
    bottom: 80px;
    right: 30px;
    background-color: var(--background-light);
    color: var(--primary-dark);
    padding: 15px 20px;
    border-radius: var(--border-radius);
    border: 2px solid var(--primary-dark);
    font-size: 1rem;
    font-weight: 500;
    box-shadow: var(--card-shadow);
    transition: all var(--transition-speed);
    cursor: pointer;
    z-index: 10;
}

.create-btn:hover {
    background-color: var(--primary-dark);
    color: var(--text-on-primary);
    border-color: var(--text-on-primary);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

/* Note and Todo Items */
.note-item, .todo-item {
    background-color: var(--background-light);
    color: var(--text-dark);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    cursor: pointer;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    display: flex;
    flex-direction: column;
    text-align: left;
    min-height: 150px;
    position: relative;
    overflow: hidden;
}

.note-item:hover, .todo-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.note-header, .todo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.todo-header {
    align-items: flex-start;
}

.item-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-right: 10px;
    word-break: break-word;
}

.note-date, .todo-date {
    font-size: 0.8rem;
    color: #777;
}

.note-preview {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 15px;
    line-height: 1.5;
}

.todo-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 10px 0;
}

.todo-priority {
    font-weight: bold;
}

.note-actions, .todo-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: auto;
}

.edit-btn, .delete-btn {
    padding: 5px 10px;
    border-radius: var(--border-radius);
    background-color: transparent;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all var(--transition-speed);
}

.edit-btn {
    color: var(--primary-dark);
    border: 1px solid var(--primary-dark);
}

.delete-btn {
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

.edit-btn:hover {
    background-color: var(--primary-dark);
    color: var(--text-on-primary);
}

.delete-btn:hover {
    background-color: var(--danger-color);
    color: var(--text-on-primary);
}

/* Todo Priority Styles */
.todo-item.priority-high {
    border-left: 5px solid var(--danger-color);
}

.todo-item.priority-medium {
    border-left: 5px solid var(--warning-color);
}

.todo-item.priority-low {
    border-left: 5px solid var(--success-color);
}

.todo-item.completed {
    opacity: 0.7;
}

.todo-item.completed .item-title {
    text-decoration: line-through;
}

.todo-checkbox {
    margin-right: 10px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 90%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    background-color: var(--background-light);
    border-radius: var(--border-radius);
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-speed);
    transform: translate(-50%, -50%) scale(0.9);
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-header h2 {
    color: var(--primary-dark);
    font-size: 1.8rem;
    font-family: "Fascinate", system-ui;
}

.exit-btn {
    background-color: transparent;
    border: none;
    color: var(--text-dark);
    font-size: 2rem;
    cursor: pointer;
    padding: 0 10px;
    transition: color var(--transition-speed);
}

.exit-btn:hover {
    color: var(--danger-color);
}

.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.title-input {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 2px solid var(--primary-dark);
    font-size: 1.1rem;
    background-color: var(--background-light);
    color: var(--text-dark);
}

#note-input {
    width: 100%;
    height: 200px;
    padding: 12px;
    border-radius: 10px;
    border: 2px solid var(--primary-dark);
    background-color: var(--background-light);
    color: var(--text-dark);
    font-size: 1rem;
    resize: vertical;
    min-height: 150px;
}

.date-input,
.priority-select {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 2px solid var(--primary-dark);
    font-size: 1rem;
    background-color: var(--background-light);
    color: var(--text-dark);
}

.modal-footer {
    padding: 15px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.action-btn {
    padding: 10px 25px;
    border-radius: 30px;
    border: none;
    background-color: var(--primary-color);
    color: var(--text-on-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.action-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.action-btn.secondary {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.action-btn.secondary:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* Bottom Menu */
.bottom-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--background-light);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 50;
}

.theme-toggle,
.settings {
    display: flex;
    align-items: center;
    gap: 10px;
}

#theme-label {
    color: var(--text-dark);
    font-size: 0.9rem;
}

.bottom-menu button {
    background-color: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    border-radius: 50%;
    transition: background-color var(--transition-speed);
}

.bottom-menu button:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.bottom-menu img {
    width: 24px;
    height: 24px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .menu-bar {
        flex-direction: column;
        gap: 15px;
    }
    
    .search-container {
        width: 100%;
        justify-content: center;
        max-width: 350px;
        margin: 10px 0;
    }

    #search-bar {
        font-size: 0.9rem;
    }
    
    .nav-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .nav-buttons button {
        flex: 1;
        text-align: center;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
        padding: 10px 20px;
    }
    
    .create-btn {
        right: 50%;
        transform: translateX(50%);
        bottom: 70px;
    }
    
    .create-btn:hover {
        transform: translateX(50%) translateY(-3px);
    }
    
    .modal {
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.note-item, .todo-item {
    animation: fadeIn 0.5s ease-in-out;
}

/* Utilities */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/***Styling for the TO DO LIST SECTION***/

/* Todo Controls */
.todo-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    width: 100%;
    max-width: 1200px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.todo-controls select,
.category-input {
    padding: 8px 12px;
    border-radius: 20px;
    border: 1px solid var(--primary-dark);
    background-color: var(--background-light);
    color: var(--text-dark);
    font-size: 0.9rem;
}

.todo-controls label {
    color: var(--text-on-primary);
    font-weight: 500;
}

/* Todo Stats */
.todo-stats {
    width: 100%;
    max-width: 1200px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 15px;
    margin-bottom: 20px;
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.stats-header h3 {
    color: var(--text-on-primary);
    font-size: 1.2rem;
    margin: 0;
}

.completion-bar {
    height: 20px;
    width: 200px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.completion-progress {
    height: 100%;
    background-color: var(--success-color);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.completion-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-on-primary);
    font-size: 0.8rem;
    font-weight: 500;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 10px;
    border-radius: 10px;
    color: var(--text-on-primary);
}

.stat-warning {
    background-color: rgba(231, 76, 60, 0.7);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 600;
}

.stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
}

/* Todo Item Enhancements */
.todo-item {
    position: relative;
}

.overdue-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--danger-color);
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: bold;
}

.todo-category {
    display: inline-block;
    background-color: var(--primary-light);
    color: var(--text-on-primary);
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.8rem;
    margin-top: 5px;
}

.todo-notes {
    margin: 10px 0;
    font-style: italic;
    color: #777;
    border-left: 3px solid var(--primary-light);
    padding-left: 10px;
}

.todo-actions {
    justify-content: flex-end;
    gap: 5px;
    margin-top: 10px;
}

.view-btn {
    color: var(--primary-dark);
    border: 1px solid var(--primary-dark);
    padding: 5px 10px;
    border-radius: var(--border-radius);
    background-color: transparent;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all var(--transition-speed);
}

.view-btn:hover {
    background-color: var(--primary-dark);
    color: var(--text-on-primary);
}

/* Task Details Modal */
.details-modal .modal-body {
    padding: 20px;
}

.task-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.detail-label {
    color: #777;
    font-size: 0.9rem;
    font-weight: 500;
}

.detail-value {
    font-size: 1.1rem;
}

.completed-status {
    color: var(--success-color);
    font-weight: bold;
}

.active-status {
    color: var(--primary-dark);
    font-weight: bold;
}

.task-notes {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 15px;
    border-radius: var(--border-radius);
    margin-top: 20px;
}

.task-notes h3 {
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: var(--primary-dark);
}

.notes-content {
    white-space: pre-wrap;
    line-height: 1.5;
}

.notes-input {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border-radius: 10px;
    border: 2px solid var(--primary-dark);
    background-color: var(--background-light);
    color: var(--text-dark);
    font-size: 1rem;
    resize: vertical;
    font-family: inherit;
}

/* Category Input */
.category-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    .todo-controls {
        flex-direction: column;
    }
    
    .control-group {
        width: 100%;
        justify-content: space-between;
    }
    
    .stats-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .completion-bar {
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .task-detail-grid {
        grid-template-columns: 1fr;
    }

}



