/* Notes Page Styles */
.back-button {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    margin-right: 1rem;
}

.notes-content {
    display: flex;
    flex-direction: column;
    padding-bottom: 80px;
}

.notes-toolbar {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
    gap: 0.5rem;
}

.search-container {
    flex: 1;
    display: flex;
    align-items: center;
    background-color: var(--search-bg, #f5f5f5);
    border-radius: 8px;
    padding: 0.7rem 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .search-container {
    background-color: #2d2d3a;
}

.search-container i {
    color: var(--text-color-light, #888);
    margin-right: 0.5rem;
}

.search-container input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    color: var(--text-color);
    font-size: 0.9rem;
}

.notes-sort button {
    background-color: var(--button-bg, #f5f5f5);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    cursor: pointer;
    transition: background-color 0.2s;
}

[data-theme="dark"] .notes-sort button {
    background-color: #2d2d3a;
}

.notes-sort button:hover {
    background-color: var(--button-hover-bg, #e5e5e5);
}

[data-theme="dark"] .notes-sort button:hover {
    background-color: #3d3d4a;
}

.notes-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.note-card {
    background-color: var(--card-background);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    overflow: hidden;
}


.note-card.completed {
    border: 1px solid #1dd1a1;
}

.completed-badge {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: #1dd1a1;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.note-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    padding-right: 1.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.note-preview {
    color: var(--text-color-light, #777);
    font-size: 0.9rem;
    line-height: 1.4;
    overflow: hidden;
    position: relative;
}

.note-preview.collapsed {
    max-height: 4.2em; /* 3 lines */
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.note-preview.expanded {
    max-height: none;
}

.show-more-btn {
    color: var(--primary-color);
    font-size: 0.8rem;
    cursor: pointer;
    display: inline-block;
    margin-top: 0.3rem;
    font-weight: 500;
    user-select: none;
}

.show-more-btn:hover {
    text-decoration: underline;
}

.note-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.8rem;
    font-size: 0.8rem;
    color: var(--text-color-light, #999);
}

.note-category {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--category-color, #8880FE);
    font-weight: 500;
    transition: opacity 0.2s;
    padding: 2px 8px;
    border-radius: 12px;
    background-color: rgba(var(--category-rgb, 136, 128, 254), 0.1);
}

.note-category i {
    font-size: 0.9rem;
}

.note-date {
    font-style: italic;
}

.notes-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 1rem;
    height: 50vh;
    color: var(--text-color-light, #888);
}

.empty-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    opacity: 0.6;
}

.notes-empty h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.notes-empty p {
    font-size: 0.9rem;
    max-width: 80%;
}

.add-note-btn {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
    z-index: 10;
}

.scroll-top-btn {
    position: fixed;
    bottom: 150px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(1.5px);
    -webkit-backdrop-filter: blur(1.5px);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s, opacity 0.3s, visibility 0.3s;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

[data-theme="dark"] .scroll-top-btn {
    background-color: rgba(0, 0, 0, 0.2);
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.scroll-top-btn:hover {
    transform: translateY(-3px);
    background-color: rgba(var(--primary-rgb, 136, 128, 254), 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.scroll-top-btn:active {
    transform: scale(0.95);
}

.add-note-btn:active {
    transform: scale(0.95);
}

/* Note Modal Styles */
.note-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.note-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--background-color);
    width: 90%;
    max-width: 500px;
    height: 90vh;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.3s;
}

.note-modal.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 1rem;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
}

.modal-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-modal {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.close-modal:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 1.5rem 1rem;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
    display: flex;
    flex-direction: column;
}

.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 20px;
    opacity: 0.7;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input, 
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color, #ddd);
    background-color: var(--input-bg, white);
    color: var(--text-color);
    font-family: inherit;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
    font-size: 1rem;
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group textarea {
    background-color: #2d2d3a;
    border-color: #444;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
}

.form-group textarea {
    height: 220px;
    margin-bottom: 1rem;
}

.note-category-selector {
    margin-top: auto;
    margin-bottom: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color, #eee);
}

.category-label {
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    color: var(--text-color-light, #777);
}

.category-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.category-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--border-color, #ddd);
    background-color: var(--card-background);
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s;
    flex: 1;
    min-width: 80px;
}

.category-option i {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.category-option span {
    font-size: 0.8rem;
}

.category-option.selected {
    border-color: var(--category-color, #8880FE);
    transform: scale(1.05);
}

.category-option:hover {
    border-color: var(--category-color, #8880FE);
}

.modal-footer {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color, #eee);
}

.modal-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    background-color: transparent;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

.action-btn:hover {
    transform: scale(1.1);
}

.action-btn:active {
    transform: scale(0.95);
}

.delete-note {
    color: #ff6b6b;
    border: 1px solid var(--border-color);
}

.delete-note:hover {
    background-color: rgba(255, 107, 107, 0.1);
}

.complete-note {
    color: #1dd1a1;
    border: 1px solid var(--border-color);
}

.complete-note:hover {
    background-color: rgba(29, 209, 161, 0.1);
}

.complete-note.active {
    background-color: rgba(29, 209, 161, 0.2);
    border-color: #1dd1a1;
    color: #1dd1a1;
}

.complete-note.active::after {
    content: 'Task completed';
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    white-space: nowrap;
    color: #1dd1a1;
    background-color: var(--background-color);
    padding: 2px 6px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.complete-note.active:hover::after {
    opacity: 1;
}

.action-btn.hidden {
    visibility: hidden;
}

.save-note {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

.save-note:hover {
    background-color: var(--secondary-color, #7770e5);
}

.save-note:active {
    transform: scale(0.95);
}

/* Delete Confirmation Popup */
.delete-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.delete-popup.active {
    opacity: 1;
    visibility: visible;
}

.delete-popup-content {
    background-color: var(--background-color);
    width: 90%;
    max-width: 340px;
    border-radius: 12px;
    overflow: hidden;
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.3s;
}

.delete-popup.active .delete-popup-content {
    transform: translateY(0);
}

.delete-icon {
    font-size: 2.5rem;
    color: #ff6b6b;
    margin-bottom: 1rem;
}

.delete-popup h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.delete-popup p {
    color: var(--text-color-light, #777);
    margin-bottom: 1.5rem;
}

.delete-popup-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.cancel-delete, .confirm-delete {
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
    border: none;
}

.cancel-delete {
    background-color: var(--button-bg, #f5f5f5);
    color: var(--text-color);
}

[data-theme="dark"] .cancel-delete {
    background-color: #2d2d3a;
}

.confirm-delete {
    background-color: #ff6b6b;
    color: white;
}

.cancel-delete:hover, .confirm-delete:hover {
    transform: scale(1.05);
}

.cancel-delete:active, .confirm-delete:active {
    transform: scale(0.95);
}

@media (max-width: 480px) {
    .category-options {
        gap: 0.5rem;
    }
    
    .category-option {
        padding: 0.6rem;
        min-width: 70px;
    }
    
    .modal-content {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .note-title {
        font-size: 1rem;
    }
    
    .modal-body {
        padding: 1.2rem 1rem;
    }
    
    .form-group input, 
    .form-group textarea {
        padding: 0.7rem 0.9rem;
    }
}

@media (max-width: 320px) {
    .category-option {
        min-width: 60px;
        padding: 0.5rem;
    }
    
    .category-option i {
        font-size: 1rem;
    }
    
    .category-option span {
        font-size: 0.7rem;
    }
    
    .save-note {
        padding: 0.7rem 1rem;
    }
} 