/* components.css - Small reusable components like buttons, toasts */

/* Buttons */
.add-note-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

.add-note-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.empty-action {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
}

.logout-btn {
    width: 100%;
    padding: 8px 0;
    background-color: transparent;
    color: #f44336;
    border: 1px solid #f44336;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color 0.2s;
    font-weight: 600;
}

.logout-btn:hover {
    background-color: rgba(244, 67, 54, 0.05);
}

.modal-btn {
    padding: 8px 16px;
    margin-left: 10px;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
}

.modal-btn-cancel {
    background-color: transparent;
    color: var(--text-color);
    border: 1px solid #e0e0e0;
}

.modal-btn-confirm {
    background-color: var(--primary-color);
    color: white;
    border: none;
}

/* Bulk delete button */
.bulk-delete-btn {
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: 10px;
    transition: background-color 0.2s, transform 0.2s;
}

.bulk-delete-btn:hover {
    background-color: #d32f2f;
    transform: translateY(-1px);
}

.bulk-delete-btn:active {
    transform: translateY(1px);
}


/* Delete All Categories button */
.delete-all-btn {
    width: 100%;
    padding: 8px 0;
    background-color: transparent;
    color: #f44336;
    border: 1px solid #f44336;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color 0.2s;
    font-weight: 600;
    margin-bottom: 10px;
}

.delete-all-btn:hover {
    background-color: rgba(244, 67, 54, 0.05);
}

/* To add spacing between buttons */
.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Dark mode support */
body.dark-mode .delete-all-btn {
    color: #ff6b6b;
    border-color: #ff6b6b;
}

body.dark-mode .delete-all-btn:hover {
    background-color: rgba(255, 107, 107, 0.1);
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #323232;
    color: white;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-size: 14px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 1100;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Nav toggle for mobile */
.nav-toggle {
    display: none;
    position: fixed;
    top: 10px;
    left: 10px;
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    z-index: 100;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

/* Mobile styles */
@media (max-width: 768px) {
    /* Specifically adjust the notes header layout for mobile */
    .notes-header {
        position: relative;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 15px;
    }
    
    /* Center category title */
    .current-category {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        text-align: center;
        z-index: 1;
        pointer-events: none; /* Allow clicks to pass through */
        max-width: 60%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Style for bulk delete button on mobile */
    .bulk-delete-btn {
        font-size: 0; /* Hide text on mobile */
        padding: 0;
        margin: 0;
        border-radius: 50%;
        width: 32px;
        height: 32px;
        display: flex;
        justify-content: center;
        align-items: center;
        position: relative;
        z-index: 2; /* Above the centered title */
        background-color: #f44336; /* Ensure red background is visible */
    }
    
    .bulk-delete-btn::before {
        content: "🗑️";
        font-size: 16px;
    }
    
    /* Make sure the add button stays properly positioned */
    .add-note-btn {
        position: relative;
        z-index: 2; /* Above the centered title */
        margin-left: 0; /* Reset margin */
    }
    
    /* Show the nav toggle for mobile */
    .nav-toggle {
        display: flex;
    }
}

/* Small screens */
@media (max-width: 480px) {
    .notes-header {
        padding: 10px;
    }
    
    .bulk-delete-btn {
        width: 28px;
        height: 28px;
    }
    
    .bulk-delete-btn::before {
        font-size: 14px;
    }
    
    .add-note-btn {
        width: 32px;
        height: 32px;
        font-size: 20px;
    }
    
    .current-category {
        font-size: 16px;
        max-width: 50%; /* Prevent long names from overlapping buttons */
    }
}


/* User info and username display in header */
.user-info {
    display: flex;
    align-items: center;
    margin-right: 15px;
    position: relative;
}

.username-display {
    font-size: 14px;
    font-weight: 500;
    color: var(--primary-color);
    padding: 6px 12px;
    background-color: rgba(98, 0, 238, 0.1);
    border-radius: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

/* Mobile styles */
@media (max-width: 768px) {
    .notes-header {
        justify-content: space-between;
        padding: 12px 15px;
        position: relative;
    }
    
    .user-info {
        position: absolute;
        top: 50%;
        right: 60px; /* Space for add note button */
        transform: translateY(-50%);
        margin-right: 0;
        z-index: 2; /* Above the centered category title */
    }
    
    .username-display {
        font-size: 12px;
        padding: 4px 8px;
        max-width: 100px;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .username-display {
        max-width: 80px;
    }
}
